How can I save a variable value in a local database , so I can get the variable's value again when I start my program again.
I want to allow the user to change his PIN number and use the new one when he start the program again.
It is a windows form application and I have a button to change the pin code which is used to allow the user to open the program
private void button17_Click(object sender, EventArgs e)
{
/*
The change PIN number has a problem and the pin number needs to be on a database or a text file in order to be updated correctly
*/
if (message.TextLength != 0 && message.TextLength < 5)
{
message.Text = "Enter Your Current 4 digits PIN ";
if (Convert.ToInt32(message.Text) == currentpinn)
{
message.Text = "Enter Your New 4 digits PIN ";
currentpinn = Convert.ToInt32(message.Text);
message.Text = " Your PIN has changed successfully ";
}
message.Text = "The PIN you have entered is not correct please try again! ";
}
else
{
message.Text = "Please enter a valied PIN ";
}
}