| You are here: DEVPPL ‹ Forum ‹ Programming ‹ Visual Basic Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Text File
16 posts
• Page 2 of 2 • 1, 2
0
Re: Text File
the strearwriter has to be declared as new in some versions
try this.
Dim sfds As New SaveFileDialog
sfds.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"
sfds.ShowDialog()
Dim objStreamWriter As New System.IO.StreamWriter(sfds.FileName)
objStreamWriter = System.IO.File.AppendText _
("file") ' this is where you put the name of the file.
objStreamWriter.WriteLine _
(RichTextBox1.Text & vbNewLine & RichTextBox2.Text)
objStreamWriter.Close()
try this.
Dim sfds As New SaveFileDialog
sfds.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"
sfds.ShowDialog()
Dim objStreamWriter As New System.IO.StreamWriter(sfds.FileName)
objStreamWriter = System.IO.File.AppendText _
("file") ' this is where you put the name of the file.
objStreamWriter.WriteLine _
(RichTextBox1.Text & vbNewLine & RichTextBox2.Text)
objStreamWriter.Close()
- Jblues
- Reputation: 0
- Posts: 13
- Joined: Tue May 03, 2011 12:08 pm
- Highscores: 0
- Arcade winning challenges: 0
- Darren
- Reputation: 0
- Posts: 13
- Joined: Tue May 03, 2011 1:30 pm
- Highscores: 0
- Arcade winning challenges: 0
- Jblues
- Reputation: 0
- Posts: 13
- Joined: Tue May 03, 2011 12:08 pm
- Highscores: 0
- Arcade winning challenges: 0
- Darren
- Reputation: 0
- Posts: 13
- Joined: Tue May 03, 2011 1:30 pm
- Highscores: 0
- Arcade winning challenges: 0
0
Re: Text File
delete the old codek, replace with this.
I am not sure if this is what you want to do, but it will work
Dim objStreamWriter As System.IO.StreamWriter
objStreamWriter = System.IO.File.AppendText _
("C:\Users\Admin\desktop\discop.txt") ' you will have to change the path
objStreamWriter.WriteLine _
(RichTextBox1.Text & vbNewLine & RichTextBox2.Text)
objStreamWriter.Close()
End Sub
I am not sure if this is what you want to do, but it will work
Dim objStreamWriter As System.IO.StreamWriter
objStreamWriter = System.IO.File.AppendText _
("C:\Users\Admin\desktop\discop.txt") ' you will have to change the path
objStreamWriter.WriteLine _
(RichTextBox1.Text & vbNewLine & RichTextBox2.Text)
objStreamWriter.Close()
End Sub
- Jblues
- Reputation: 0
- Posts: 13
- Joined: Tue May 03, 2011 12:08 pm
- Highscores: 0
- Arcade winning challenges: 0
0
Re: Text File
Fantastic Thank you so much I really appreciate what you have done Brilliant Regards
- Darren
- Reputation: 0
- Posts: 13
- Joined: Tue May 03, 2011 1:30 pm
- Highscores: 0
- Arcade winning challenges: 0
|
|