六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

WEB頁面多語言支持處理方案

[摘要]首先建立語言檔,在項目中加入.resx文件例如:message.zh-cn.resx '簡體中文message.zh-tw.resx '繁體中文message.en '英文..............=====================================...

首先建立語言檔,在項目中加入.resx文件
例如:
message.zh-cn.resx '簡體中文
message.zh-tw.resx '繁體中文
message.en '英文
..............
=========================================
然后利用Name --Value 鍵值對 填入你要在頁面上顯示的語言
如:
name value
message.zh-cn.resx中:
res_loginbname 登陸名 :
message.zh-tw.resx中:
res_loginbname 登陸名 :
message.zh-cn.resx中:
res_loginbname Login Name :

=========================================
然后在Golbal.asax中加入多語言設定支持代碼(瀏覽器需要支持Cookie)

'=========================================
' Application_BeginRequest Event
'
' The Application_BeginRequest method is an ASP.NET 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 Request.Cookies("resource") Is Nothing Or Request.Cookies("resource").Value = "" Then
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.Cookies("resource").Value)
Else
Thread.CurrentThread.CurrentCulture = New CultureInfo(ConfigurationSettings.AppSettings("DefaultCulture"))
End If
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture
Catch ex As Exception
Thread.CurrentThread.CurrentCulture = New CultureInfo(ConfigurationSettings.AppSettings("DefaultCulture"))
End Try
End Sub 'Application_BeginRequest

在Web.Config中加入如下代碼,用于設定編碼和默認語種,在Global.asax中有調用:

=========================================
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<appSettings>
<add key="DefaultCulture" value="zh-cn" />
<!-- zh-cn:簡體中文 zh-tw:繁體中文 en:英文 -->
</appSettings>

 

=========================================
頁面代碼中使用多語言支持:

Imports System.Resources

Public Class 類名
Inherits System.Web.UI.Page
Protected LocRM As ResourceManager = New ResourceManager("項目文件名.message", GetType(類名).Assembly)

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblLogin.Text = LocRM.GetString("res_login")
End Sub
End Class


=========================================

到這里多語言支持的工作就作完了,接下來自己去慢慢Key
message.zh-cn.resx '簡體中文
message.zh-tw.resx '繁體中文
message.en '英文

這幾個語言檔吧




主站蜘蛛池模板: 日韩不卡高清视频 | 色婷婷激婷婷深爱五月老司机 | 午夜国产精品影院在线观看 | 亚洲成综合人影院在院播放 | 日本五级床片在线观看 | 日韩三级在线 | 亚洲精品老司机在线观看 | 欧美一级黄色录像片 | 天堂中文在线资源 | 青青青国产精品视频 | 色噜噜狠狠大色综合 | 中文字幕亚洲一区 | 亚洲视频在线一区 | 四虎影院永久免费 | 欧美香蕉视频在线观看 | 天堂a在线| 日韩国产中文字幕 | 天天看片天天a免费观看 | 深夜福利影院在线观看 | 日韩激情成人 | 婷婷综合久久中文字幕一本 | 在线亚洲日产一区二区 | 天堂中文网 | 中文字幕专区在线亚洲 | 中文字幕免费视频精品一 | 一级黄色在线播放 | 亚洲都市激情 | 午夜老司机在线观看 | 亚洲成人在线网站 | 日韩精品专区 | 天天色天天射天天操 | 一级黄色片视频 | 思思久久96热在精品国产免费 | 婷婷六月久久综合丁香乐透 | 新男人天堂 | 青青青青久在线观看视频 | 欧美无人区码卡二卡3卡4免费 | 欧美中文娱乐网 | 最新69国产成人精品视频69 | 伊人狠狠干 | 天天狠天天透天干天天怕处 |