Multilingual use in ASP.NET

xiaoxiao2021-03-06  66

Private ResourceManager Multilang = New ResourceManager ("demo.Languages.test", assembly.getexecutingassembly ()); // Web station name. Place the multi-language directory. To use the language pack (will automatically select Test according to the language status of the process .zh-tw.resx, test.en-us.resx, ...)

Private void page_load (object sender, system.eventargs e) {if (! "]Guage"] == null) {if (Request.cookies ["LAN"]! = null) {session [" Language "] = Request.cookies [" LAN "]. Value; // Speaking of the language selected by the current user} else {session [" Language "] =" en-us ";}} this.ci = new cultureInfo Session [ "language"] ToString ());. Thread.CurrentThread.CurrentUICulture = this.ci; txtA.Text = MultiLang.GetString ( "txtA"); // the value set in the language pack txtA}}

转载请注明原文地址:https://www.9cbs.com/read-110056.html

New Post(0)