Writing data to a file problem

stuartp01

New member
Joined
May 7, 2008
Messages
3
Programming Experience
Beginner
Hi, i am trying to save text from a textBox into a text file but the code editor in Visual Studio 2003 (vb.net) has a problem with it. it follows this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim data As String
data = TextBox1.Text
Open "C:\Documents and Settings\Stu\My Documents\Visual Studio Projects\data\order.txt" For Output AS #1
Print #1, data
Close #1
MsgBox("Text saved.")
End Sub

in particular it does not like Open this does not seem to be a function of vb.net 2003?? does any 1 know the actual function?

can anyone see what is wrong with this way of doing this or is there a better way? any help will be greatly appreciated. thanks
stuart
 

Latest posts

Back
Top