Got an issue here. I have a program that when it starts a loginForm dialog pops up. Now on this loginForm I've added a rememberMe (onthoudMij) button. So if the user selects this box log's in, closes the program and then opens it again, his user credentials will already be filled in.
Here's my code for my loginButton.
private void loginButton_Click(object sender, EventArgs e)
{
try
{
var sr = new System.IO.StreamReader("C:\\" + inlogNaamTextbox.Text + "\\Login.txt");
gebruikersnaam = sr.ReadLine();
passwoord = sr.ReadLine();
sr.Close();
if (gebruikersnaam == inlogNaamTextbox.Text && passwoord == inlogPasswoordTextbox.Text)
{
classUsername.name = inlogNaamTextbox.Text;
MessageBox.Show("Je bent nu ingelogd!", "Succes!");
this.Dispose();
}
else
{
MessageBox.Show("Gebruikersnaam of wachtwoord fout!", "Fout!");
}
}
catch (System.IO.DirectoryNotFoundException ex)
{
MessageBox.Show("De gebruiker bestaat niet!", "Fout!");
}
}
NOW MY PROBLEM IS:
I have searched the web for options on remember me implementation, but they always use SQL databases etc. I just have a login that stores the username & password in a txt file as you can see in the code.
Question is..
So no my question is; How can I implement this remember me checkbox? I already know I should use System.Net , but what else for this to work without sql databases or anything like that?