using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Globalization; using System.Threading; public partial class Register : System.Web.UI.Page { public string dtime; public string vipnumber; protected void Page_Load(object sender, EventArgs e) { dtime = DateTime.Now.ToString(); vipnumber = Methods1.Methods1.Numbers(); litMen.Text = Resources.Cinowo.Nan; litWomen.Text = Resources.Cinowo.Nv; BtnSubmit.Text = Resources.Cinowo.Registration; RequiredFieldValidator1.ErrorMessage = Resources.Cinowo.QingtianxieUserName; RequiredFieldValidator2.ErrorMessage = Resources.Cinowo.QingTianXieMima; RequiredFieldValidator3.ErrorMessage = Resources.Cinowo.ZaiCiShuruPwd; CompareValidator1.ErrorMessage = Resources.Cinowo.MimaBuYiZhi; RequiredFieldValidator4.ErrorMessage = Resources.Cinowo.EmailNotNull; RegularExpressionValidator1.ErrorMessage = Resources.Cinowo.EmailError; } public void addmember() { string password = Methods1.Methods1.Md5(Txtpwd.Text, 32); string sql = "insert into membertab(cid,cinowo_id,passwd,sex,names,nickname,birthday,address,postcode,telephone,regdate,qs,ans) values('" + vipnumber + "','" + txtmail.Text + "','" + password + "','" + (tBtnMen.Checked == true ? 1 : 0) + "','" + txtXM.Text + "','" + Txtname.Text + "','" + txtBirthday.Text + "','" + txtadress.Text + "','" + txtpostcode.Text + "','" + txtphone.Text + "','" + dtime + "','" + txtqs.Text + "','" + txtans.Text + "')"; int i = DBH.DBHelper.ExecuteNonQuery(sql); if (i > 0) { Methods1.Methods1.Alert(this, "注册已成功!", "default.aspx"); } else { Methods1.Methods1.Alert(this, "对不起,系统繁忙,请稍候重新注册!"); } } protected override void InitializeCulture() { if (Session["lang"] != null) { string lang = Session["lang"].ToString(); if (!String.IsNullOrEmpty(lang)) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang); base.InitializeCulture(); } } } protected void LinkButton1_Click(object sender, EventArgs e) { Session["Lang"] = "zh-cn"; Response.Redirect(Request.Url.ToString()); } protected void LinkButton2_Click(object sender, EventArgs e) { Session["Lang"] = "en-us"; Response.Redirect(Request.Url.ToString()); } protected void Button1_Click(object sender, EventArgs e) { if (txtCheck.Text.Trim().Equals(Session["CheckCode"].ToString())) { addmember(); } else { //this.RegisterStartupScript("", ""); Methods1.Methods1.Alert(this, "验证码不正确"); } } }