Results 1 to 5 of 5

Thread: [RESOLVED] Textbox Saveing [Easy Question]

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    37

    Resolved [RESOLVED] Textbox Saveing [Easy Question]

    Hi all I need help with textbox saveing.

    first the text

    I'm making something like registering your self to something.
    like

    Name:[ Here the textbox]
    Age:[ Here text box]

    Register Button

    If I click on the register button it should make a textfile with the information innit that works fine but I also want that the text "Name:" and "Age" commes infront of the data in the textfile what I'm now getting is only the data i want it like this in the textfile


    Name: VBforums
    Age: 99


    This is my code I cant figure out how to do that
    Code:
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Dim sWriter As New System.IO.StreamWriter("C:\vbforums.txt", True)
    
            sWriter.WriteLine(TextBox2.Text)
    
            sWriter.WriteLine(TextBox1.Text)
    
            sWriter.Close()
    
        End Sub
    Thx already !!!

    ~ NitroAfg

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Textbox Saveing [Easy Question]

    Code:
            Dim sWriter As New System.IO.StreamWriter("C:\vbforums.txt", True)
            sWriter.WriteLine("Name: " & TextBox2.Text)
            sWriter.WriteLine("Age: " & TextBox1.Text)
            sWriter.Close()
    Assuming textbox1 is your age box, and textbox2 is your name box, this will write out the values from them to the textfile, with the string literals of "Name: " and "Age: " before them (note the space after the : to make the text file easier to read)

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    37

    Smile Re: Textbox Saveing [Easy Question]

    Thx dude it worked nice

    BTW can I send the textbox to my e-mail. When clickin on the Register button.

    Sorry for my bad english ..


    Thx !!

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [RESOLVED] Textbox Saveing [Easy Question]

    yes you can, but it would require the user or you provide SMTP information that will work for their machine to send email. This usually does not work well, as it is not very compatible or you get people who do not know what settings should be used, or you need different ports configured for various ISP

    What I actually do is I made a webservice on my website, and I send the data I want to email to the webservice. The webservice then emails the data to me from my website. This works better. Not sure if that is an option for you though.

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    37

    Re: [RESOLVED] Textbox Saveing [Easy Question]

    Quote Originally Posted by kleinma
    yes you can, but it would require the user or you provide SMTP information that will work for their machine to send email. This usually does not work well, as it is not very compatible or you get people who do not know what settings should be used, or you need different ports configured for various ISP

    What I actually do is I made a webservice on my website, and I send the data I want to email to the webservice. The webservice then emails the data to me from my website. This works better. Not sure if that is an option for you though.
    Thx thats a great ID

    I'm using hotmail WLM MSN :P

    but I'm not looking for the idea of yours

    I want that the program sends the textfile to my e-mail :P

    thanx dough

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