ASP.NET 3.5(c#)区域化设置(LCID)

简介:   /// <summary>     ///区域设置ID(LCID)     ///涂聚文 http://geovindu.blog.163.com     /// </summary>     /// <param name="sender"></param>     /// <param name="e"&

 

/// <summary>
    ///区域设置ID(LCID)
    ///涂聚文 http://geovindu.blog.163.com
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Response.ContentEncoding = Encoding.UTF8;
            Response.Write("<table border=/"1/">");
            Response.Write(ShowDateTimeCurrency("af-ZA"));
            Response.Write(ShowDateTimeCurrency("sq-AL"));
            Response.Write(ShowDateTimeCurrency("ar-DZ"));
            Response.Write(ShowDateTimeCurrency("ar-BH"));
            Response.Write(ShowDateTimeCurrency("ar-EG"));
            Response.Write(ShowDateTimeCurrency("ar-IQ"));
            Response.Write(ShowDateTimeCurrency("ar-JO"));
            Response.Write(ShowDateTimeCurrency("ar-KW"));
            Response.Write(ShowDateTimeCurrency("ar-LB"));
            Response.Write(ShowDateTimeCurrency("ar-LY"));
            Response.Write(ShowDateTimeCurrency("ar-MA"));
            Response.Write(ShowDateTimeCurrency("ar-OM"));
            Response.Write(ShowDateTimeCurrency("ar-QA"));
            Response.Write(ShowDateTimeCurrency("ar-SA"));
            Response.Write(ShowDateTimeCurrency("ar-SY"));
            Response.Write(ShowDateTimeCurrency("ar-TN"));
            Response.Write(ShowDateTimeCurrency("ar-AE"));
            Response.Write(ShowDateTimeCurrency("ar-YE"));
            Response.Write(ShowDateTimeCurrency("hy-AM"));
           // Response.Write(ShowDateTimeCurrency("az-AZ-Cyrl"));
            Response.Write(ShowDateTimeCurrency("eu-ES"));
            Response.Write(ShowDateTimeCurrency("ca-ES"));
            Response.Write(ShowDateTimeCurrency("be-BY"));
            Response.Write(ShowDateTimeCurrency("bg-BG"));
            Response.Write(ShowDateTimeCurrency("hr-HR"));
            Response.Write(ShowDateTimeCurrency("cs-CZ"));
            Response.Write(ShowDateTimeCurrency("da-DK"));
            //Response.Write(ShowDateTimeCurrency("div-MV"));
            Response.Write(ShowDateTimeCurrency("nl-BE"));
            Response.Write(ShowDateTimeCurrency("nl-NL"));
            Response.Write(ShowDateTimeCurrency("et-EE"));
            Response.Write(ShowDateTimeCurrency("fo-FO"));
            Response.Write(ShowDateTimeCurrency("fa-IR"));
            Response.Write(ShowDateTimeCurrency("fi-FI"));
            Response.Write(ShowDateTimeCurrency("fr-BE"));
            Response.Write(ShowDateTimeCurrency("fr-CA"));
            Response.Write(ShowDateTimeCurrency("fr-FR"));
            Response.Write(ShowDateTimeCurrency("fr-LU"));
            Response.Write(ShowDateTimeCurrency("fr-MC"));
            Response.Write(ShowDateTimeCurrency("fr-CH"));
            Response.Write(ShowDateTimeCurrency("gl-ES"));
            Response.Write(ShowDateTimeCurrency("ka-GE"));
            Response.Write(ShowDateTimeCurrency("de-AT"));
            Response.Write(ShowDateTimeCurrency("de-DE"));
            Response.Write(ShowDateTimeCurrency("de-LI"));
            Response.Write(ShowDateTimeCurrency("de-LU"));
            Response.Write(ShowDateTimeCurrency("de-CH"));
            Response.Write(ShowDateTimeCurrency("el-GR"));
            Response.Write(ShowDateTimeCurrency("gu-IN"));
            Response.Write(ShowDateTimeCurrency("he-IL"));
            Response.Write(ShowDateTimeCurrency("hi-IN"));
            Response.Write(ShowDateTimeCurrency("hu-HU"));
            Response.Write(ShowDateTimeCurrency("is-IS"));
            Response.Write(ShowDateTimeCurrency("id-ID"));
            Response.Write(ShowDateTimeCurrency("it-IT"));
            Response.Write(ShowDateTimeCurrency("it-CH"));
            Response.Write(ShowDateTimeCurrency("kn-IN"));
            Response.Write(ShowDateTimeCurrency("kk-KZ"));
            Response.Write(ShowDateTimeCurrency("kok-IN"));
            Response.Write(ShowDateTimeCurrency("ky-KG"));
            Response.Write(ShowDateTimeCurrency("lv-LV"));
            Response.Write(ShowDateTimeCurrency("lt-LT"));
            Response.Write(ShowDateTimeCurrency("mk-MK"));
            Response.Write(ShowDateTimeCurrency("ms-BN"));
            Response.Write(ShowDateTimeCurrency("ms-MY"));
            Response.Write(ShowDateTimeCurrency("mr-IN"));
            Response.Write(ShowDateTimeCurrency("mn-MN"));
            Response.Write(ShowDateTimeCurrency("nb-NO"));
            Response.Write(ShowDateTimeCurrency("nn-NO"));
            Response.Write(ShowDateTimeCurrency("pl-PL"));
            Response.Write(ShowDateTimeCurrency("pt-BR"));
            Response.Write(ShowDateTimeCurrency("pt-PT"));
            Response.Write(ShowDateTimeCurrency("ro-RO"));
            Response.Write(ShowDateTimeCurrency("ru-RU"));
            Response.Write(ShowDateTimeCurrency("sa-IN"));
            Response.Write(ShowDateTimeCurrency("sk-SK"));
            Response.Write(ShowDateTimeCurrency("sl-SI"));
            Response.Write(ShowDateTimeCurrency("es-AR"));
            Response.Write(ShowDateTimeCurrency("es-BO"));
            Response.Write(ShowDateTimeCurrency("es-CL"));
            Response.Write(ShowDateTimeCurrency("es-CO"));
            Response.Write(ShowDateTimeCurrency("es-CR"));
            Response.Write(ShowDateTimeCurrency("es-DO"));
            Response.Write(ShowDateTimeCurrency("es-EC"));
            Response.Write(ShowDateTimeCurrency("es-SV"));
            Response.Write(ShowDateTimeCurrency("es-GT"));
            Response.Write(ShowDateTimeCurrency("es-HN"));
            Response.Write(ShowDateTimeCurrency("es-MX"));
            Response.Write(ShowDateTimeCurrency("es-NI"));
            Response.Write(ShowDateTimeCurrency("es-PA"));
            Response.Write(ShowDateTimeCurrency("es-PY"));
            Response.Write(ShowDateTimeCurrency("es-PE"));
            Response.Write(ShowDateTimeCurrency("es-PR"));
            Response.Write(ShowDateTimeCurrency("es-ES"));
            Response.Write(ShowDateTimeCurrency("es-UY"));
            Response.Write(ShowDateTimeCurrency("es-VE"));
            Response.Write(ShowDateTimeCurrency("sw-KE"));
            Response.Write(ShowDateTimeCurrency("sv-FI"));
            Response.Write(ShowDateTimeCurrency("sv-SE"));
            Response.Write(ShowDateTimeCurrency("syr-SY"));
            Response.Write(ShowDateTimeCurrency("ta-IN"));
            Response.Write(ShowDateTimeCurrency("tt-RU"));
            Response.Write(ShowDateTimeCurrency("te-IN"));
            Response.Write(ShowDateTimeCurrency("th-TH"));
            Response.Write(ShowDateTimeCurrency("tr-TR"));
            Response.Write(ShowDateTimeCurrency("uk-UA"));
            Response.Write(ShowDateTimeCurrency(""));
            Response.Write(ShowDateTimeCurrency("en-US"));
            Response.Write(ShowDateTimeCurrency("en-AU"));
            Response.Write(ShowDateTimeCurrency("en-BZ"));
            Response.Write(ShowDateTimeCurrency("en-CA"));
           // Response.Write(ShowDateTimeCurrency("en-CB"));
            Response.Write(ShowDateTimeCurrency("en-IE"));
            Response.Write(ShowDateTimeCurrency("en-JM"));
            Response.Write(ShowDateTimeCurrency("en-NZ"));
            Response.Write(ShowDateTimeCurrency("en-PH"));
            Response.Write(ShowDateTimeCurrency("en-ZA"));
            Response.Write(ShowDateTimeCurrency("en-TT"));
            Response.Write(ShowDateTimeCurrency("en-GB"));
            Response.Write(ShowDateTimeCurrency("en-ZW"));
            Response.Write(ShowDateTimeCurrency("ja-JP"));
            Response.Write(ShowDateTimeCurrency("de-DE"));
            Response.Write(ShowDateTimeCurrency("zh-CN"));
            Response.Write(ShowDateTimeCurrency("ko-KR"));
            Response.Write(ShowDateTimeCurrency("ru-RU"));
            Response.Write(ShowDateTimeCurrency("zh-TW"));
            Response.Write(ShowDateTimeCurrency("zh-HK"));
            Response.Write(ShowDateTimeCurrency("zh-SG"));
            Response.Write(ShowDateTimeCurrency("zh-MO"));
           // Response.Write(ShowDateTimeCurrency("zh-CHS"));
           // Response.Write(ShowDateTimeCurrency("zh-CHT"));
            Response.Write(ShowDateTimeCurrency("ur-PK"));
            //Response.Write(ShowDateTimeCurrency("uz"));
            //Response.Write(ShowDateTimeCurrency("uz-UZ-Cyrl"));
           // Response.Write(ShowDateTimeCurrency("uz-UZ-Latn"));
            //Response.Write(ShowDateTimeCurrency("vi"));
            Response.Write(ShowDateTimeCurrency("vi-VN"));

            Response.Write("</table>");
        }
        catch (Exception ex)
        {
            Response.Write("erro:" + ex.Message.ToString() + "<br/>");
        }
    }
    /// <summary>
    /// 区域化设置和符集的匹配
    /// </summary>
    /// <param name="sLocale">区域代码LCID</param>
    /// <returns>返回区域字符集</returns>
    public string ShowDateTimeCurrency(string sLocale)
    {
        Page.Culture = sLocale;
        string formateDate=(DateTimeFormatInfo.GetInstance(null)).LongDatePattern;
        string formateTime=(DateTimeFormatInfo.GetInstance(null)).LongTimePattern;
        int i=1000;
        string formateCurrency=i.ToString("C");
        int j=50;
        double k=0.2;
        string formateNumber=j.ToString("F")+"&"+k.ToString("F");
        string Result="<tr>";
        Result+="<td>"+CultureInfo.CurrentCulture.DisplayName+"</td>";
        Result+="<td>"+DateTime.Now.ToString(formateDate)+"</td>";
        Result+="<td>"+DateTime.Now.ToString(formateTime)+"</td>";
        Result+="<td>"+formateCurrency+"</td>";
        Result+="<td>"+formateNumber+"</td></td>";
        return (Result);

    }

目录
相关文章
|
10天前
|
C#
C# DEV 关于设置gridview 指定单元格字体为红色
C# DEV 关于设置gridview 指定单元格字体为红色
|
10天前
|
C#
C# DEV TextEdit 设置文本框只能输入数字(整数)
C# DEV TextEdit 设置文本框只能输入数字(整数)
|
3月前
|
数据采集 API 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPISDK设置软件触发模式(C#)
Baumer工业相机堡盟工业相机如何通过NEOAPISDK设置软件触发模式(C#)
38 1
|
3月前
|
存储 数据采集 数据处理
Baumer工业相机堡盟工业相机如何通过BGAPISDK设置相机的Bufferlist序列(C#)
Baumer工业相机堡盟工业相机如何通过BGAPISDK设置相机的Bufferlist序列(C#)
63 0
|
3月前
|
存储 数据管理 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置相机本身的数据保存(CustomData)功能(C#)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置相机本身的数据保存(CustomData)功能(C#)
26 0
|
3月前
|
编解码 监控 开发工具
Baumer工业相机堡盟工业相机如何通过BGAPI SDK设置相机的图像剪切(ROI)功能(C#)
Baumer工业相机堡盟工业相机如何通过BGAPI SDK设置相机的图像剪切(ROI)功能(C#)
33 0
|
1月前
|
设计模式 C#
36.c#:如何设置MDL窗口
36.c#:如何设置MDL窗口
15 1
|
3月前
|
编解码 监控 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置相机的图像剪切(ROI)功能(C#)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置相机的图像剪切(ROI)功能(C#)
14 0
|
3月前
|
算法 数据处理 开发工具
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置相机的固定帧率(C#)
Baumer工业相机堡盟工业相机如何通过NEOAPI SDK设置相机的固定帧率(C#)
26 0
|
3月前
|
算法 数据处理 C#
Baumer工业相机堡盟工业相机如何通过BGAPISDK设置相机的固定帧率(C#)
Baumer工业相机堡盟工业相机如何通过BGAPISDK设置相机的固定帧率(C#)
39 0