protected void btnGirisYap_Click(object sender, EventArgs e) { if (txtEmailAdresi.Text.Length > 100 && txtSifre.Text.Length > 6) { return; } anti = new AntiSqlInjection(); txtEmailAdresi.Text = anti.tehlikeliIfadeleriTemizle(txtEmailAdresi.Text); txtSifre.Text = anti.tehlikeliIfadeleriTemizle(txtSifre.Text); accessDatabase a = new accessDatabase(); OleDbConnection cnn = new OleDbConnection(accessDatabase.veritabaniYolu); cnn.Open(); OleDbCommand cmd2 = new OleDbCommand("Select * from uyeol Where uyeMail='" + txtEmailAdresi.Text + "' and uyeSifre='" + txtSifre.Text + "' and uyelikAktifEt=false", cnn); OleDbDataReader oku2 = cmd2.ExecuteReader(); if (oku2.Read()) { lblUyari.Text = "Ödeme yapmadığınız için giriş yapamıyorsunuz."; return; } OleDbCommand cmd = new OleDbCommand("Select * from uyeol Where uyeMail='" + txtEmailAdresi.Text + "' and uyeSifre='" + txtSifre.Text + "' and uyelikAktifEt=true", cnn); OleDbDataReader oku = cmd.ExecuteReader(); if (oku.Read()) { Session["giris"] = "uye"; Session["isim"] = oku["uyeAd"]; Response.Redirect("Default.aspx"); } else { lblUyari.Text = "Hatalı giriş yapıldı"; } }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text.Length > 100 && TextBox2.Text.Length > 8) { return; } anti = new AntiSqlInjection(); TextBox1.Text = anti.tehlikeliIfadeleriTemizle(TextBox1.Text); TextBox2.Text = anti.tehlikeliIfadeleriTemizle(TextBox2.Text); accessDatabase a = new accessDatabase(); OleDbConnection cnn = new OleDbConnection(accessDatabase.veritabaniYolu); cnn.Open(); OleDbCommand cmd = new OleDbCommand("Select * from Login Where email='" + TextBox1.Text + "' and sifre='" + TextBox2.Text + "' and hesapDondur=false", cnn); OleDbDataReader oku = cmd.ExecuteReader(); if (oku.Read()) { if ((int)a.TekVeriCekme("Select yetki from Login Where email = '" + TextBox1.Text + "' and sifre = '" + TextBox2.Text + "'") == 1) { Session["login"] = "******"; } else { Session["login"] = "******"; } Response.Redirect("icerik.aspx"); } else { Label3.Text = "Hatalı giriş yapıldı"; } }