以下是引用片段:
其主要代码实现过程如下: protected void LinkButton2_Click(object sender, EventArgs e) { //判断信息是否正确 if (TextBox1.Text.Trim() == "" || Textbox10.Text.Trim() == "") { TErr.会员帐号或身份证号不能为空>"; return; } if (TextBox1.Text.Trim() == "Administrator") { TErr.>帐号错误"; return; } if (this.Textbox5.Text.Trim() != this.Textbox6.Text.Trim()) { this.TErr.密码不一致! return; } //判断会员帐号是否重复 DataTable tmpda = new DataTable(); tmpda = DataBase.Get_Table("select * from yhxx where yhdlm='" + this.TextBox1.Text.Trim() + "'"); if (tmpda.Rows.Count > 0) { this.TErr.此帐户已经存在,请重新输入!>"; return; }
//添加注册的会员信息到数据库中 DataBase.ExecSql("insert into yhxx(yhdlm,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() +"')"); Session["UserID"] = this.TextBox1.Text.Trim(); Session["PersonType"] = "用户"; Response.Redirect("index0.aspx"); }
|