Tuesday, July 28, 2009

Visual Basic HELP?

Hi I have visual basic 2008 express edition and want to save the text in these two text boxes I got that working here is the code:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim SaveF As New System.IO.StreamWriter("C:\Password.txt"...





SaveF.Write(TextBox1.Text, Textbox2.text)





SaveF.Close()





Me.Close()


End Sub








But When it saves the text in the two text boxes into a .txt file I want the text in textbox2 to be on a new line after textbox1 in the .txt file how can I do that???

Visual Basic HELP?
SaveF.WriteLine(TextBox1.Text);


SaveF.WriteLine(TextBox2.Text);





Or, use System.Enviornment.NewLine to insert a line break.
Reply:concatenate the VBCRLF constant with the two text elements.


Here's a hint:





Dim strOut as String


strOut = TextBox1.Text %26amp; VBCRLF %26amp; TextBox2.Text


No comments:

Post a Comment