首页 | 麦客学吧 | 视频教程 | FLASH小游戏 | 素材下载 | 常用工具
您当前的位置:首页 > 程序开发 > ASP > 正文

ASP教程:浏览器的语言区域设置

出处:麦客学吧 [2008-9-26 14:13:11] 来源:Microsoft 点击数:204

讨论交流:http://x8.maicoo.com/team/18658.html

当您创建一个 Active Server Pages (ASP) 应用程序的多个 internation 站点访问时, 是有益修改区域设置设置,以便 VBScript 日期、 时间、 货币和这样 forth 格式返回指定用户的位置正确的格式。 

以下子例程动态地设置为根据 ASP 应用程序提供在用户的浏览器语言设置 (Session.LCID) 区域设置 ID: <SCRIPT Runat=Server Language=VBScript>
[code]Sub SetLCID()
  Dim strAcceptLanguage
  Dim strLCID
  Dim strPos
  
  strAcceptLanguage = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")

  strPos = InStr(1, strAcceptLanguage, ",")
  If strPos > 0 Then
    strAcceptLanguage = Left(strAcceptLanguage, strPos - 1)
  End If
   
  Select Case LCase(strAcceptLanguage)
    Case "af"
      strLCID = 1078  ' Afrikaans 
    Case "sq"
      strLCID = 1052  ' Albanian 
    Case "ar-sa"
      strLCID = 1025  ' Arabic(Saudi Arabia) 
    Case "ar-iq"
      strLCID = 2049  ' Arabic(Iraq) 
    Case "ar-eg"
      strLCID = 3073  ' Arabic(Egypt) 
    Case "ar-ly"
      strLCID = 4097  ' Arabic(Libya) 
    Case "ar-dz"
      strLCID = 5121  ' Arabic(Algeria) 
    Case "ar-ma"
      strLCID = 6145  ' Arabic(Morocco) 
    Case "ar-tn"
      strLCID = 7169  ' Arabic(Tunisia) 
    Case "ar-om"
      strLCID = 8193  ' Arabic(Oman) 
    Case "ar-ye"
      strLCID = 9217  ' Arabic(Yemen) 
    Case "ar-sy"
      strLCID = 10241 ' Arabic(Syria) 
    Case "ar-jo"
      strLCID = 11265 ' Arabic(Jordan) 
    Case "ar-lb"
      strLCID = 12289 ' Arabic(Lebanon) 
    Case "ar-kw"
      strLCID = 13313 ' Arabic(Kuwait) 
    Case "ar-ae"
      strLCID = 14337 ' Arabic(U.A.E.) 
    Case "ar-bh"
      strLCID = 15361 ' Arabic(Bahrain) 
    Case "ar-qa"
      strLCID = 16385 ' Arabic(Qatar) 
    Case "eu"
      strLCID = 1069  ' Basque 
    Case "bg"
      strLCID = 1026  ' Bulgarian 
    Case "be"
      strLCID = 1059  ' Belarusian 
    Case "ca"
      strLCID = 1027  ' Catalan 
    Case "zh-tw"
      strLCID = 1028  ' Chinese(Taiwan) 
    Case "zh-cn"
      strLCID = 2052  ' Chinese(PRC) 
    Case "zh-hk"
      strLCID = 3076  ' Chinese(Hong Kong) 
    Case "zh-sg"
      strLCID = 4100  ' Chinese(Singapore) 
    Case "hr"
      strLCID = 1050  ' Croatian 
    Case "cs"
      strLCID = 1029  ' Czech 
    Case "da"
      strLCID = 1030  ' Danish 
    Case "nl"
      strLCID = 1043  ' Dutch(Standard) 
    Case "nl-be"
      strLCID = 2067  ' Dutch(Belgian) 
    Case "en"
      strLCID = 9     ' English 
    Case "en-us"
      strLCID = 1033  ' English(United States) 
    Case "en-gb"
      strLCID = 2057  ' English(British) 
    Case "en-au"
      strLCID = 3081  ' English(Australian) 
    Case "en-ca"
      strLCID = 4105  ' English(Canadian) 
    Case "en-nz"
      strLCID = 5129  ' English(New Zealand) 
    Case "en-ie"
      strLCID = 6153  ' English(Ireland) 
    Case "en-za"
      strLCID = 7177  ' English(South Africa) 
    Case "en-jm"
      strLCID = 8201  ' English(Jamaica) 
     Case "en-ca"
      strLCID = 9225  ' English(Caribbean)"?> 
    Case "en-bz"
      strLCID = 10249 ' English(Belize) 
    Case "en-tt"
      strLCID = 11273 ' English(Trinidad) 
    Case "et"
      strLCID = 1061  ' Estonian 
    Case "fo"
      strLCID = 1080  ' Faeroese 
    Case "fa"
      strLCID = 1065  ' Farsi 
    Case "fi"
      strLCID = 1035  ' Finnish 
    Case "fr"
      strLCID = 1036  ' French(Standard) 
    Case "fr-be"
      strLCID = 2060  ' French(Belgian) 
    Case "fr-ca"
      strLCID = 3084  ' French(Canadian) 
    Case "fr-ch"
      strLCID = 4108  ' French(Swiss) 
    Case "fr-lu"
      strLCID = 5132  ' French(Luxembourg) 
    Case "mk"
      strLCID = 1071  ' Macedonian (FYROM) 
    Case "gd"
      strLCID = 1084  ' Gaelic(Scots) 
    Case "de"
      strLCID = 1031  ' German(Standard) 
    Case "de-ch"
      strLCID = 2055  ' German(Swiss) 
    Case "de-at"
      strLCID = 3079  ' German(Austrian) 
    Case "de-lu"
      strLCID = 4103  ' German(Luxem

【责任编辑: lanier

关于 ASP 浏览器 语言 的相关文章
素材中心
麦客酷站赏析频道

精彩图文推荐

关于本站 - 联系站长 - 广告服务 - 合作伙伴 - 网站地图 - 版权声明 - 报告错误 - 收藏本站 | Http://www.MaiCoo.com

Copyright © 2005 - 2008 MaiCoo.com All Rights Reserved

违法和不良信息举报中心 本站服务器空间和带宽由雷克斯网络提供赞助
浙ICP备06017818号