以下是引用片段:
核心代码如下: protected void Imagebutton2_Click(object sender, ImageClickEventArgs e) { //判断信息是否正确 if (TextBox1.Text.Trim() == "") { Page.ClientScript.RegisterStartupS('会员帐号不能为空!'>"); return; } if (TextBox1.Text.Trim() == "admin") { Page.ClientScript.'帐号错误!'>"); return; } if (this.Textbox5.Text.Trim() != this.Textbox6.Text.Trim()) { Page.ClientScript('密码不一致!'>"); return; } if (Session["UserID"] == null) { DataTable tmpda = new DataTable(); tmpda = DataBase.Get_Table("select * from hyxx where hydlm='" + this.TextBox1.Text.Trim() + "'"); if (tmpda.Rows.Count > 0) { Page.Client'此帐户已经存在,请重新输入!');<>"); return; } }
if (Session["UserID"] == null) { //添加注册的会员信息到数据库中 DataBase.ExecSql("insert into hyxx(hydlm,mm,xb,xm,dz,dh,sr,Email,sfzh) " + " values('" + this.TextBox1.Text.Trim() + "','" + this.Textbox5.Text.Trim() + "','" + this.txtxb.SelectedValue + "', " + " '" + this.Textbox2.Text.Trim() + "','" + this.TextBox3.Text.Trim() + "'," + " '" + this.TextBox4.Text.Trim() + "','" + this.Textbox7.Text.Trim() + "'," + " '" + this.Textbox8.Text + "','" + Textbox10.Text.Trim() + "')");
}
|