CultureInfo.GetCultureInfo(String name) : CultureInfo « System.Globalization « C# / C Sharp by API






CultureInfo.GetCultureInfo(String name)

 

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Text;
using System.Threading;
using System.Globalization;

public class MainClass
{
    public static void Main()
    {
        CultureInfo current = CultureInfo.CurrentCulture;
        CultureInfo currentUi = CultureInfo.CurrentUICulture;
        try
        {
            CultureInfo mexicanSpanishCi = CultureInfo.GetCultureInfo("es-MX");
            Thread.CurrentThread.CurrentCulture = mexicanSpanishCi;
            Thread.CurrentThread.CurrentUICulture = mexicanSpanishCi;
            Console.WriteLine("{0}/{1}", Thread.CurrentThread.CurrentCulture, Thread.CurrentThread.CurrentUICulture);
            Console.WriteLine("{0:C}, {1}", 1250.50m, DateTime.Now.ToLongDateString());
        }
        finally
        {
            Thread.CurrentThread.CurrentCulture = current;
            Thread.CurrentThread.CurrentUICulture = currentUi;
        }
    }
}

   
  








Related examples in the same category

1.new CultureInfo(String cult)
2.CultureInfo.Calendar
3.CultureInfo.CreateSpecificCulture
4.CultureInfo.CurrentCulture
5.CultureInfo.CurrentUICulture
6.CultureInfo.DateTimeFormat
7.CultureInfo.DisplayName
8.CultureInfo.EnglishName
9.CultureInfo.GetCultures
10.CultureInfo.NativeName
11.CultureInfo.NumberFormat
12.CultureInfo.ToString()