View Single Post
  #3 (permalink)  
Old December 29th, 2011, 07:13 PM
Gary108 Gary108 is offline
Authorized User
Points: 193, Level: 3
Points: 193, Level: 3 Points: 193, Level: 3 Points: 193, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Question

Dear Rob,

Thank you for your prompt reply. I tried setting up an application in Visual Studio exactly like the example you referred me to. It is giving me two errors. One is for the Function called "AppendText". The error is: "AppendText is not declared. It may be inaccessible due to its protection level". The second error is for "txtFileName.Text". The error is the same as above.

Is the txtFileName.Text to be replaced with a specific path and file like "C:\txtFileName.Text"? If I enter a string like that I do not get an error message and it resembles the format for writing text with Streamwriter that I am familiar with.

How do I declare a function such as "AppendText" ? Thanks so much for your ongoing help. I look forward to your reply?


Regards,

Gary




Private Sub btnAppendFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAppendFile.Click

Dim stream_writer As StreamWriter
stream_writer = AppendText(txtFileName.Text)
stream_writer.WriteLine(txtText.Text)
stream_writer.Close()


End Sub
Reply With Quote