First establish a language file, join .e.resx file, for example: message.zh-cn.resx 'simplified Chinese message.zh-tw.resx' 体 中文 Message.en 'English ......... ... =============================================== ======================= Then use the Name -Value key value to fill in the language displayed on the page such as: name value message.zh- CN.RESX: RES_LOGINBNAME Land Name: Message.zh-Tw.resx: RES_LOGINBNAME Land Name: rssage.zh-cn.resx: Res_loginbname login name: =============== ============================================================================================================================================================================================================= ===== Then add multilingual setting support code in Golbal.asax (the browser needs to support cookie) '======================== ============================================================================================================================================================================================================= =================1 ''
The Thread Culture Is Set for Each Request Using the Language 'Settings'' =================================== ============================================================================================================================================================================================================= ======== Sub Application_BeginRequest (ByVal sender As Object, ByVal e As EventArgs) TryIf Not Request.Cookies ( "resource") Is Nothing Or Request.Cookies ( "resource"). Value = "" ThenThread.CurrentThread .CurrentCulture = CultureInfo.CreateSpecificCulture (Request.Cookies ( "resource"). Value) ElseThread.CurrentThread.CurrentCulture = New CultureInfo (ConfigurationSettings.AppSettings ( "DefaultCulture")) End IfThread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCultureCatch ex As ExceptionThread.CurrentThread.CurrentCulture = New CultureInfo (ConfigurationSettings.AppSettings ( "DefaultCulture")) End TryEnd Sub 'Application_BeginRequest in Web.Config added the following code, and coding for setting default language, there are calls in the Global.asax: = ============================================================================================================================================================================================================= =================== ResponseEncoding = "UTF-8" />