示例#1
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            Mesaj msj = new Mesaj();

            this.Hide();
            msj.Show();
        }
示例#2
0
 private void btnGiris_Click(object sender, EventArgs e)
 {
     if (txtEposta.Text != "" & txtSifre.Text != "")
     {
         if (txtEposta.Text.Length <= 70 & txtSifre.Text.Length <= 12)
         {
             if (chckRemember.Checked)
             {
                 Properties.Settings.Default.u_eposta = txtEposta.Text;
                 Properties.Settings.Default.u_sifre  = txtSifre.Text;
                 Properties.Settings.Default.Save();
             }
             else
             {
                 Properties.Settings.Default.u_eposta = "";
                 Properties.Settings.Default.u_sifre  = "";
                 Properties.Settings.Default.Save();
             }
             SqlConnection con = new SqlConnection("Server=.;Database=LocalChat;Trusted_Connection=True;");
             SqlCommand    cmd = new SqlCommand();
             con.Open();
             cmd.Connection  = con;
             cmd.CommandText = "Select * from Uye where uye_eposta='" + txtEposta.Text + "' AND uye_sifre='" + txtSifre.Text + "'";
             SqlDataReader dr = cmd.ExecuteReader();
             if (dr.Read())
             {
                 Mesaj msj = new Mesaj();
                 this.Hide();
                 msj.Show();
             }
             else
             {
                 MessageBox.Show("Lütfen e-posta ve şifre bilgilerinizi kontrol ediniz!");
             }
             con.Close();
         }
         else
         {
             if (txtEposta.Text.Length > 70)
             {
                 MessageBox.Show("E-postanız 70 karakterden fazla olamaz!");
             }
             else if (txtSifre.Text.Length > 12)
             {
                 MessageBox.Show("Şifreniz 12 karakterden fazla olamaz!");
             }
         }
     }
     else
     {
         MessageBox.Show("Lütfen e-postanızı ve şifrenizi giriniz!");
     }
     KayitOl.id = cookie();
 }