|
-
Jul 8th, 2008, 02:45 PM
#1
Thread Starter
Member
[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
-
Jul 8th, 2008, 02:48 PM
#2
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)
-
Jul 8th, 2008, 02:52 PM
#3
Thread Starter
Member
-
Jul 8th, 2008, 03:41 PM
#4
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.
-
Jul 8th, 2008, 03:48 PM
#5
Thread Starter
Member
Re: [RESOLVED] Textbox Saveing [Easy Question]
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|