예제 #1
0
 private void btn_Giris_Click(object sender, EventArgs e)
 {
     if (txt_kullanici_adi.Text == "" || txt_sifre.Text == "")
     {
         MessageBox.Show("Kullanıcı Adı veya Şifreyi Boş Geçemezsiniz.", "MESAJ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     else
     {
         try
         {
             bool sonuc = false;
             kullanici_adi = txt_kullanici_adi.Text;
             sonuc         = giris_kontrolu.kullanıcı_kontrol(baglanti_adresi, kullanici_adi, Convert.ToInt32(txt_sifre.Text));
             if (sonuc == true)
             {
                 frm_AnaKontrol ana_menu = new frm_AnaKontrol();
                 ana_menu.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("Kullanıcı Adı Veya Şifre Yanlış.\nTest Girişi Yapmak İçin \nKullanıcı Adı : admin Şifre : 123", "KULLANICI GİRİŞ HATASI", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 txt_sifre.Clear();
             }
         }
         catch (FormatException) { MessageBox.Show("Şifre Sadece Rakamlardan Oluşur.", "SONUÇ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
         catch (Exception hata) { MessageBox.Show("Bağlantı Hatası Oluştu.Hata Olma Nedenleri:\n1. Bilgisayarınızda SQL SERVER yüklü değil\n2. SQL SERVER Dosyaları Veri Tabanına Eklenmediğinden\n3. SQL SERVER Dosyalarını Eklerken WİNDOWS AUTHECTİCATİON OLARAK SERVER NAME OLARAK . KULLANINIZ ", "SONUÇ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
     }
 }