string wjl = "server=.;database=lele;uid=sa;pwd=123456";
SqlConnection weijiale = new SqlConnection(wjl);
weijiale.Open();
string wyq = "insert into wei(name,password) values('" + TextBox1.Text + " ','" + TextBox7.Text + "')";
SqlCommand jiale = new SqlCommand(wyq, weijiale);
jiale.ExecuteNonQuery();
Response.Write("<script>alert('注册成功!!!')</script>");
' " + + " '
var i ,sum:integer; begin sum:=0; for i:=1 to 100 do begin sum:=sum+i; end; writeln(sum); readln
var i ,sum:integer; begin sum:=0; i:=0; repeat sum:=sum+i; i:=i+1; until i>100; writeln(sum); readln end.
var i,sum:integer; begin sum:=0; while (i<=100) do begin sum:=sum+i; i:=i+1; end; writeln(sum); readln end.
if (TextBox3.Text != Session["CheckCode"].ToString())
{
La1.Text= "对不起,验证码错误!";
}
else
{
string strCon = "server=.;database=load;uid=sa;pwd=111111";
SqlConnection conn = new SqlConnection(strCon);
conn.Open();
string strSql = "select count(*) from [user] where name='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'";
SqlCommand cmd = new SqlCommand(strSql, conn);
int mo = Convert.ToInt32(cmd.ExecuteScalar());
if (mo > 0)
{
Session["ok"] = "1"; //通过Session变量来记录用户的登录状态。
Session["name"] = TextBox1.Text;
Response.Redirect("index.aspx");
}
else
{
Response.Write("<script>alert('用户名或密码错误,请重新输入!');location.href='default.aspx';</script>");
}
}