Logine (code normal)
SqlCommand cmd = new SqlCommand();
[Link] = "insert into tarik
values('"+[Link]+"','"+[Link]+"')";
[Link] = [Link];
[Link] = con;
[Link]();
Logine (code session)
Session["login"] = [Link];
Session["password"] = [Link];
if (Session["login"] == "tarik" && Session["password"] == "tarik")
{
[Link]("[Link]");
}
Logine + password :
HttpCookie x = new HttpCookie("a");
[Link]("login", [Link]);
[Link]("mp", [Link]);
[Link](x);
[Link] = [Link](1);
recuper logine + password
HttpCookie x = new HttpCookie("a");
x = [Link]["a"];
[Link] = [Link]("login");
[Link] = [Link]("mp");
Afficher IP :
[Link] = [Link]["Remote_ADDR"];
Afficher langue :
[Link] = [Link]["HTTP_Accept_language"];
messageBox ;
string a = [Link]();
[Link]("<script> alert('" + a + "');</script>");
Nombre viisiteur :
Application_Start
{
Application["User "]=0;
}
Session_Start
{
Int a;
a=[Link](Application["nb_user"].ToString());
a=a+1;
Application["nb_user"]=a;
}
[Link] = Application["User"].ToString();
Telecharger fichier : (FileUpload1)
string a = [Link]("uploads/");
string nomfichier;
if ([Link] == true)
{
nomfichier = [Link];
[Link](a + nomfichier);
}
Page_Load
{
if ([Link] == false)
{
charger();
}
}
SelectedIndexChanged
{
[Link] = [Link][3].Text;
[Link] = [Link][4].Text;
charger();
}
public void charger()
{
SqlConnection con = new
SqlConnection("server=.;database=gestion_peche;integrated security=true");
SqlDataAdapter da = new SqlDataAdapter("select * from poisson",con);
DataSet ds = new DataSet();
[Link](ds);
[Link] = ds;
[Link]();
}
RowEditing {
//pour editer
[Link] = [Link];
charger();
}
RowCancelingEdit {
//pour annulerl'edition
[Link] = -1;
charger();
}
RowDeleting
{
SqlConnection con = new
SqlConnection("server=.;database=gestion_peche;integrated security=true");
[Link]();
string t = [Link][[Link]].Cells[3].Text;
SqlParameter p = new SqlParameter("@num",[Link](t));
SqlCommandcmd = new SqlCommand("delete from poisson where
num_poisson=@num", con);
[Link](p);
[Link]();
[Link]();
charger();
}
RowUpdating
{
SqlConnection con = new
SqlConnection("server=.;database=gestion_peche;integrated security=true");
[Link]();
TextBox t1 = (TextBox)[Link][[Link]].Cells[3].Controls[0];
TextBox t2 = (TextBox)[Link][[Link]].Cells[4].Controls[0];
SqlParameter p1 = new SqlParameter("@num",[Link]([Link]));
SqlParameter p2 = new SqlParameter("@nom",[Link]);
SqlCommandcmd = new SqlCommand("update poisson set nom_poisson=@nom from
poisson where num_poisson=@num",con);
[Link](p1);
[Link](p2);
[Link]();
[Link]();
[Link] = -1;
charger();
}
}
foreach (GridViewRow g in [Link])
{
CheckBox cb = (CheckBox)[Link]("CheckBox1");
if ([Link] == true)
{
int a = [Link]([Link][1].Text);
SqlConnection con = new
SqlConnection("server=.;database=gestion_peche;integrated security=true");
[Link]();
SqlParameter p = new SqlParameter("@num",a);
SqlCommand cmd = new SqlCommand("delete poisson from
poisson where num_poisson=@num", con);
[Link](p);
[Link]();
[Link]();
charger();
}
}