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

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

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 '英文

這幾個語言檔吧




主站蜘蛛池模板: 中文字幕乱码视频中文字幕14 | 日本一道在线观看 | 青娱娱乐盛宴免费一二区 | 日本红怡院亚洲红怡院最新 | 欧美综合在线观看 | 天天做天天添天天谢 | 亚洲成a人片在线v观看 | 日韩性大片免费 | 欧美特黄三级在线观看 | 性生活国产 | 亚洲视频一区在线播放 | 日日拍拍| 日韩在线天堂免费观看 | 日韩va亚洲va欧美va浪潮 | 亚洲欧美中文日韩在线v日本 | 伊人官网 | 日本爱爱视频 | 日日摸夜夜搂人人要 | 视频在线观看40分钟免费 | 天天拍天天射 | 亚洲视频欧美视频 | 色天天影视 | 午夜久久久久久亚洲国产精品 | 欧美在线伊人 | 色播五月激情五月 | 天天操天天做 | 日韩不卡免费视频 | 亚洲图片综合区另类图片 | 偷拍第一页 | 日日操夜夜骑 | 羞羞一区二区三区四区片 | 天天色天天操天天 | 日本xxxxxx片免费播放18 | 四虎影视在线免费观看 | 青青草原网站在线观看 | 色视频线观看在线播放 | 日韩毛片免费观看 | 婷婷综合久久中文字幕一本 | 日韩三级伦理在线 | 欧美在线不卡 | 一级做性色a爰片久久毛片 一级做受视频免费是看美女 |