using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Globalization; using System.Threading; public partial class Resetpwd : System.Web.UI.Page { public string cid; protected void Page_Load(object sender, EventArgs e) { if (Session["Lang"] != null) { if (Session["Lang"] == "zh-cn") { RequiredFieldValidator1.ErrorMessage = "密码不能为空"; RequiredFieldValidator2.ErrorMessage = "确认密码不能为空"; CompareValidator1.ErrorMessage = "输入的两个新密码不一样"; } else if (Session["Lang"] == "en-us") { RequiredFieldValidator1.ErrorMessage = "The password can not be empty"; RequiredFieldValidator2.ErrorMessage = "Confirm the password can not be empty"; CompareValidator1.ErrorMessage = "Entered two new passwords do not"; } } if (Request.QueryString["id"] != null) { cid = Request.QueryString["id"].ToString(); } } protected void ibtnfi_Click(object sender, EventArgs e) { string code;//重设密码发到邮箱的验证码 code = Session["reset"].ToString(); string password = Methods1.Methods1.Md5(txtpwd.Text, 32);//给密码加密 if (code == this.txtcode.Text) { string sql = "update membertab set passwd='" + password + "' where cid='" + cid + "'"; int i = Convert.ToInt32(DBH.DBHelper.ExecuteNonQuery(sql)); if (i > 0) { Response.Write(""); } else { Response.Write(""); } } else { Response.Write(""); } } protected override void InitializeCulture() { if (Session["lang"] != null) { string lang = Session["lang"].ToString(); if (!String.IsNullOrEmpty(lang)) { //UICulture - 决定了采用哪一种本地化资源,也就是使用哪种语言 //Culture - 决定各种数据类型是如何组织,如数字与日期 Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang); base.InitializeCulture(); } } } protected void LinkButton2_Click(object sender, EventArgs e) { Session["Lang"] = "en-us"; Response.Redirect(Request.Url.ToString()); } protected void LinkButton1_Click(object sender, EventArgs e) { Session["Lang"] = "zh-cn"; Response.Redirect(Request.Url.ToString()); } }