实现网站的中英文转换

原文:http://jinxubin0317.blog.163.com/blog/static/56045079201041391222720/ 

protected override void InitializeCulture()

        {

            string culture = Request.QueryString["curlanguage"];

            if (!String.IsNullOrEmpty(culture))

            {

                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);

                System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(culture);

            }

        }

        protected void Page_Load(object sender, EventArgs e)

        {

            if (!IsPostBack)

            {

                ltlcountry.Text = Resources.language.country.ToString();

                ltlcity.Text = Resources.language.city.ToString();

                ltlcountry2.Text =(string)GetGlobalResourceObject("language", "country");

                ltlcity2.Text=(string)GetGlobalResourceObject("language", "city");

            }

        }

posted @ 2010-05-13 22:36  Rain520  阅读(719)  评论(0编辑  收藏  举报