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.
Printable View
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.
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,
VB Code:
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