Results 1 to 2 of 2

Thread: Newbie Question: Creating file from data in textboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    1

    Newbie Question: Creating file from data in textboxes

    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.

  2. #2
    Registered User jkw119's Avatar
    Join Date
    Oct 2001
    Location
    Pittsburgh
    Posts
    256
    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:
    1. Dim Document As New System.IO.FileStream("Document.txt", IO.FileMode.Create, IO.FileAccess.Write)
    2. Dim w As New System.IO.StreamWriter(Document)
    3. a = textbox1.text
    4. b = textbox2.text
    5. c = textbox3.text
    6. w.BaseStream.Seek(0, IO.SeekOrigin.End)
    7. w.WriteLine("Textbox1 = " & a)
    8. w.WriteLine("Textbox1 = " & b)
    9. w.WriteLine("Textbox1 = " & c)
    10. w.Flush()
    11. 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width