Change the current cultures to Mexican Spanish : CultureInfo : I18N Internationalization C# Examples


C# Examples » I18N Internationalization » CultureInfo »

 

Change the current cultures to Mexican Spanish









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



Output

es-MX/es-MX
$1,250.50, domingo, 25 de marzo de 2007


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo I18N Internationalization
» CultureInfo