PDA

Click to See Complete Forum and Search --> : Newbie Question: Creating file from data in textboxes


TSSC
Jun 25th, 2002, 05:16 AM
I have a form. In that form i have multiple text boxes and i need to create a file from the data entered in these forms. Can someone explain to me how i can go about this. I am new to visual basic so any help would be appreciated.

jkw119
Jun 25th, 2002, 09:53 AM
well, in vb.net, there are about a millions ways to do this. you can create .html, .txt, xml, whatever you want. there is a document object model (DOM) that makes everything simple. For example,


Dim Document As New System.IO.FileStream("Document.txt", IO.FileMode.Create, IO.FileAccess.Write)
Dim w As New System.IO.StreamWriter(Document)
a = textbox1.text
b = textbox2.text
c = textbox3.text
w.BaseStream.Seek(0, IO.SeekOrigin.End)
w.WriteLine("Textbox1 = " & a)
w.WriteLine("Textbox1 = " & b)
w.WriteLine("Textbox1 = " & c)
w.Flush()
w.Close()



my preference has been writing data to an html file, and just putting the appropriate tags. and i am just learning xml for large data files, and it has been incredible. anyway, i hope that helps...

jeff