andyhoole
May 11th, 2009, 06:05 AM
This is part of a project i am trying to create, the project has a form for registration. I have managed to create the text file to store the registration details like this.
Andrew,flower
Bill,monkey
Derek,starfish
However on another form i am trying to complete a password log on form, where it looks up the user name and password from the pre saved text file.
I can not get it too work. I have posted what i have written for the storage of the details.
Dim writer As New System.IO.StreamWriter("pass.txt", True)
If TextBox7.Text <> TextBox8.Text Then
MessageBox.Show("The passwords you have entered do not match", "Error", MessageBoxButtons.OK)
TextBox7.Text = ""
TextBox8.Text = ""
Else
writer.Write(TextBox1.Text & ",")
writer.Write(TextBox7.Text & ",")
writer.Write(TextBox2.Text & ",")
writer.Write(TextBox3.Text & ",")
writer.Write(TextBox4.Text & ",")
writer.Write(TextBox5.Text & ",")
writer.WriteLine(TextBox6.Text & ",")
writer.Flush()
writer.Close()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
MessageBox.Show("You have successfully registered, please log on now", "Thank you", MessageBoxButtons.OK)
Me.Close()
Logon.Show()
End If
Thank you
Andrew,flower
Bill,monkey
Derek,starfish
However on another form i am trying to complete a password log on form, where it looks up the user name and password from the pre saved text file.
I can not get it too work. I have posted what i have written for the storage of the details.
Dim writer As New System.IO.StreamWriter("pass.txt", True)
If TextBox7.Text <> TextBox8.Text Then
MessageBox.Show("The passwords you have entered do not match", "Error", MessageBoxButtons.OK)
TextBox7.Text = ""
TextBox8.Text = ""
Else
writer.Write(TextBox1.Text & ",")
writer.Write(TextBox7.Text & ",")
writer.Write(TextBox2.Text & ",")
writer.Write(TextBox3.Text & ",")
writer.Write(TextBox4.Text & ",")
writer.Write(TextBox5.Text & ",")
writer.WriteLine(TextBox6.Text & ",")
writer.Flush()
writer.Close()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
MessageBox.Show("You have successfully registered, please log on now", "Thank you", MessageBoxButtons.OK)
Me.Close()
Logon.Show()
End If
Thank you