パスワードを変数としてコードに入れる代わりに、ログインフォームを少し変更することを考えています.パスワードを暗号化してテキストファイルに保存する方法はありますか?ログインするたびに、テキストファイル??
private void button1_Click(object sender, EventArgs e)
{
string username1 = "Richard";
string password1 = "Peugeot";
if (this.textBox1.Text == username1 && this.textBox2.Text == password1)
{
MessageBox.Show("Welcome Richard!", "Welcome");
Form1 frm = new Form1();
frm.Show();
this.Hide();
}
else
MessageBox.Show("Incorrect username or password", "Bad credentials");
}