1. 应用程序级别

    <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);

    }

  2. 页面级别

    <%@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>

     

  3. 线程级别

    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>");

    }

     

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-06-07
猜你喜欢
  • 2021-12-26
  • 2021-10-19
  • 2022-02-22
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案