using System; using System.Data; using System.Globalization; using System.Threading; using System.Web.Services; public partial class Us : System.Web.UI.Page { public static DataTable dts; protected void Page_Load(object sender, EventArgs e) { bind(); } 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()); } public void bind() { string sql; if (Session["Lang"] != null) { if (Session["Lang"] == "zh-cn") { sql = "select contents from othertab where typename='联系我们' order by dates desc"; } else { sql = "select Econtent as contents from othertab where typename='联系我们' order by dates desc"; } } else { sql = "select contents from othertab where typename='联系我们' order by dates desc"; } dts = DBH.DBHelper.GetDataSet(sql); } 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(); } } } [WebMethod] public static int DelApL(int AID) { return 520; } }