illustrates the current cultures : CultureInfo I18N « Internationalization I18N « C# / C Sharp






illustrates the current cultures

illustrates the current cultures
/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/

/*
  Example21_8.cs illustrates the current cultures
*/

using System;
using System.Globalization;
using System.Threading;

public class Example21_8 
{

  public static void Main() 
  {
    // set the current culture for the executing thread
    Thread.CurrentThread.CurrentCulture=new CultureInfo("de-DE");
    // and display it
    Console.WriteLine(Thread.CurrentThread.CurrentCulture.Name);
    // create another new culture
    CultureInfo ci = new CultureInfo("en-US");
    // prove that this doesn't change the current culture
    Console.WriteLine(CultureInfo.CurrentCulture.Name);

    // set the current UI culture for the executing thread
    Thread.CurrentThread.CurrentUICulture=new CultureInfo("fr-FR");
    // and display it
    Console.WriteLine(Thread.CurrentThread.CurrentUICulture.Name);
    // create another new culture
    CultureInfo ci2 = new CultureInfo("en-US");
    // prove that this doesn't change the current culture
    Console.WriteLine(CultureInfo.CurrentUICulture.Name);

  }

}




           
       








Related examples in the same category

1.new CultureInfo("da-DK")
2.Create Culture info in es-US
3.Create Culture info for fr-FRCreate Culture info for fr-FR
4.Set Culture to current threadSet Culture to current thread
5.Create culture info from CurrentUICultureCreate culture info from CurrentUICulture
6.Derive Number Format info from culture infoDerive Number Format info from culture info
7.Print all Culture infoPrint all Culture info
8.new CultureInfo( "de-DE" )new CultureInfo(
9.new CultureInfo( "ru-RU" )new CultureInfo(
10.enumerates all available culturesenumerates all available cultures
11.illustrates the CultureInfo classillustrates the CultureInfo class
12.illustrates the CultureInfo class 2