Determine the language version of the client in ASP.NET, give the right home page

xiaoxiao2021-03-06  49

For websites with multi-language version, you need to judge what language to the user, use the request.headers property to identify the type of the client language

Commonly used language code is:

L ???????? 简体 中文: zh-cn L ???????? Traditional: zh-tww ???????? en ??? eNGLISH? L ????? ??? EN-US ENGLISH

United State

Usage: if (Request.Headers ["accept-language"]. TOSTRING ()) == "zh-cn") {?????? response.redirect ("chinesever.aspx");} else {? ????? response.redirect ("OtherLanguagever.aspx");} or use Request.UserLanguages, similar to the above usage. ?

?

转载请注明原文地址:https://www.9cbs.com/read-116868.html

New Post(0)