First create a language file and add .resx files to the project
For example:
'Simplified Chinese
'Traditional Chinese
'English
..............
=========================================
Then use the Name --Value key-value pair to fill in the language you want to display on the page
like:
name value
middle:
res_loginbname login name:
middle:
res_loginbname login name:
middle:
res_loginbname Login Name :
=========================================
Then add multi-language setting support code (browser needs to support cookies)
'=========================================
' Application_BeginRequest Event
'
' The Application_BeginRequest method is an event that executes
' on each web request into the portal application.
'
' The thread culture is set for each request using the language
' settings
'
'=========================================
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Try
If Not ("resource") Is Nothing Or ("resource").Value = "" Then
= (("resource").Value)
Else
= New CultureInfo(("DefaultCulture"))
End If
=
Catch ex As Exception
= New CultureInfo(("DefaultCulture"))
End Try
End Sub 'Application_BeginRequest
Add the following code to set the encoding and default languages, and there are calls in it:
=========================================
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<appSettings>
<add key="DefaultCulture" value="zh-cn" />
<!-- zh-cn:Simple Chinese zh-tw:Traditional Chinese en:English -->
</appSettings>
=========================================
Multilingual support is used in the page code:
Imports
Public Class Class Name
Inherits
Protected LocRM As ResourceManager = New ResourceManager("Project file name.message", GetType(Class name).Assembly)
Private Sub Page_Load(ByVal sender As , ByVal e As ) Handles
= ("res_login")
End Sub
End Class
=========================================
Here, the multi-language support work is finished, and then go slowly to key it
'Simplified Chinese
'Traditional Chinese
'English
These languages are