You are here: DEVPPL Forum Programming Visual Basic Forum
NOTIFICATIONS
54.317
MEMBERS
15.720
TOPICS
62.398
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

Text File

0

Loading

Re: Text File

Postby Jblues » Tue May 03, 2011 6:08 pm

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()
Jblues
 
Reputation: 0
Posts: 13
Joined: Tue May 03, 2011 12:08 pm
Highscores: 0
Arcade winning challenges: 0

Re: Text File - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: Text File

Postby Darren » Tue May 03, 2011 6:30 pm

jblues
No errors and the text file is created but nothing inside the file Regards
Darren
 
Reputation: 0
Posts: 13
Joined: Tue May 03, 2011 1:30 pm
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: Text File

Postby Jblues » Tue May 03, 2011 7:14 pm

What is the name and location of the text file.
Jblues
 
Reputation: 0
Posts: 13
Joined: Tue May 03, 2011 12:08 pm
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: Text File

Postby Darren » Tue May 03, 2011 7:28 pm

jblues,
The file is called discop saved to Desktop
Darren
 
Reputation: 0
Posts: 13
Joined: Tue May 03, 2011 1:30 pm
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: Text File

Postby Jblues » Tue May 03, 2011 7:35 pm

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
Jblues
 
Reputation: 0
Posts: 13
Joined: Tue May 03, 2011 12:08 pm
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: Text File

Postby Darren » Tue May 03, 2011 7:42 pm

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
Previous
^ Back to Top