C# ile kullanıcı & şifre ile giriş sistemi yapmak

[CODE lang="csharp" title="BUTTONA EKLENCEK KOD"] if (textBox1.Text == "KULLANCI ADI BURAYA" && textBox2.Text == "ŞİFRENİZ BURAYA")
{
MessageBox.Show("Giriş Başarılı");
}
else


{
MessageBox.Show("Hatalı Giriş");
}[/CODE]


Proje üzerine örnek resim;

1619723849955.png
 
C#:
string username = textBox1.Text;
string password = textBox2.Text;

if (username == "" || password == ""){
      MessageBox.Show("Lütfen boş alanları doldurunuz.","Program");
}else{
    if (username == "KULLANCI ADI BURAYA" && password == "ŞİFRENİZ BURAYA"){
                MessageBox.Show("Giriş Başarılı");
            }else{
                MessageBox.Show("Hatalı Giriş");
            }
}

Sanırım böyle daha iyi oldu.
 

Geri
Yukarı