- 应用程序级别
<configuration>
<system.web>
<globalization uiculture="zh-HK" culture="ja-JP">
</globalization></system.web>
</configuration>
public void Page_Load()
{
Response.Write ("Current Culture is " + CultureInfo.CurrentCulture.EnglishName);
}
- 页面级别
<%@Page Culture="fr-FR" Language="C#" %>
<% @Import Namespace="System.Globalization" %>
<html>
<head>
</head>
<script runat="server">
public void Page_Load()
{
Response.Write ("Current Culture is " + CultureInfo.CurrentCulture.EnglishName);
}
</script>
<body></body>
</html>
- 线程级别
public void Page_Load()
{
// Display the Current Culture
Response.Write("Current Culture is " +
Thread.CurrentThread.CurrentCulture.EnglishName + "<br>");
// Modify the Current Culture
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Response.Write("Changing Culture to " +
Thread.CurrentThread.CurrentCulture.EnglishName + "<br>");
}