protected void Button1_Click(object sender, EventArgse)
protectedvoidButton1_Click(objectsender,EventArgse)//{if(TextBox1.Text.ToString().Tri...
protected void Button1_Click(object sender, EventArgse) // {
if(TextBox1.Text.ToString().Trim() == "" ||TextBox2.Text.ToString().Trim() == "" ||TextBox3.Text.ToString().Trim() == "")
{
Response.Write("<script>javascript:alert('请填写完整');history.back();</script>");
}
else
{
if(TextBox2.Text.ToString().Trim() != TextBox3.Text.ToString().Trim())
{
Response.Write("<script>javascript:alert('两次密码不一致,请确认');history.back();</script>");
}
else
{
string sql;
sql = "select * from allusers where username='" +Session["username"].ToString().Trim() + "' and pwd='" +TextBox1.Text.ToString().Trim() + "'";
DataSet result = new DataSet();
result = new Class1().hsggetdata(sql);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
sql = "update allusers set pwd='" +TextBox2.Text.ToString().Trim() + "' where username='" +Session["username"].ToString().Trim() + "'";
int result2;
result2 = new Class1().hsgexucute(sql);
if (result2 == 1)
{
Response.Write("<script>javascript:alert('修改成功');</script>");
Response.Redirect("login.aspx");
}
else
{
Response.Write("<script>javascript:alert('系统错误');</script>");
}
}
else
{
Response.Write("<script>javascript:alert('原密码不正确');</script>");
}
}
}
}
求说明 展开
if(TextBox1.Text.ToString().Trim() == "" ||TextBox2.Text.ToString().Trim() == "" ||TextBox3.Text.ToString().Trim() == "")
{
Response.Write("<script>javascript:alert('请填写完整');history.back();</script>");
}
else
{
if(TextBox2.Text.ToString().Trim() != TextBox3.Text.ToString().Trim())
{
Response.Write("<script>javascript:alert('两次密码不一致,请确认');history.back();</script>");
}
else
{
string sql;
sql = "select * from allusers where username='" +Session["username"].ToString().Trim() + "' and pwd='" +TextBox1.Text.ToString().Trim() + "'";
DataSet result = new DataSet();
result = new Class1().hsggetdata(sql);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
sql = "update allusers set pwd='" +TextBox2.Text.ToString().Trim() + "' where username='" +Session["username"].ToString().Trim() + "'";
int result2;
result2 = new Class1().hsgexucute(sql);
if (result2 == 1)
{
Response.Write("<script>javascript:alert('修改成功');</script>");
Response.Redirect("login.aspx");
}
else
{
Response.Write("<script>javascript:alert('系统错误');</script>");
}
}
else
{
Response.Write("<script>javascript:alert('原密码不正确');</script>");
}
}
}
}
求说明 展开
2014-05-03
展开全部
太乱了,看得头晕,我建议你去搜索编,程,回,忆,录,之unity3d看一下吧!零基础开始学习的,希望对你有帮助
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询