public void Kontrol()
{
HttpCookie myCookie = Request.Cookies["benimCerezim"];
OleDbConnection cnn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/vt1.mdb"));
OleDbDataReader Okuyucu;
OleDbCommand SorguSQL = new OleDbCommand("Select * from Uyeler where kullanici=@kullanici AND sifre=@sifre", cnn);
SorguSQL.Parameters.Add("@kullanici", OleDbType.VarChar).Value = DecodeFrom64(myCookie["login"]); //Gelen değeri Decode ediyoruz,
SorguSQL.Parameters.Add("@sifre", OleDbType.VarChar).Value = DecodeFrom64(myCookie["pass"]); //Gelen değeri Decode ediyoruz,
//bağlantı durumu, kapalı ise aç,
if (cnn.State == ConnectionState.Closed)
{
cnn.Open();
}
//okumaya başla
Okuyucu = SorguSQL.ExecuteReader();
//eğer varsa oku
if (Okuyucu.Read())
{
Label1.Text = "Hoşgeldiniz " + Okuyucu["adi"].ToString().ToUpper() + ";
}
else
{
Label1.Text = "Hata";
}
}