okay say i have a program that has you login to use it is there anyway that i can have it save the text in username and password so when he opens it again it will still be there ?
http://img18.imageshack.us/img18/9657/58128629.png
Printable View
okay say i have a program that has you login to use it is there anyway that i can have it save the text in username and password so when he opens it again it will still be there ?
http://img18.imageshack.us/img18/9657/58128629.png
You can use My.Settings. Just search the forums, there's tons of topics on it.
searched alot and found alot of code but none worked :(
Post the code you used and describe what didn't work.
doesnt workCode:My.Settings.remember(TextBox.Text)
wait nm i got a goog tut off youtube here is the working code
Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Settings.username = TextBox1.Text
My.Settings.Save()
My.Settings.Reload()
My.Settings.password = TextBox2.Text
My.Settings.Save()
My.Settings.Reload()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = My.Settings.Username
TextBox2.Text = My.Settings.Password
End Sub
Go to your Application properties and make sure that the check box "Save My.Settings on Close" is checked. Once you check it, you can take all the "My.Settings.Save()" and Reloads out of your code. You only need to store to it and it will automatically save.
Glad it works for you though.