The repository contains a collection of different programming snippets to different programming languages from own developments as well as other projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
programming-examples/c-sharp/Functions/C# Program to Demonstrate C...

32 lines
1.0 KiB

/*
* C# Program to Demonstrate Culture Names
*/
using System;
using System.Globalization;
using System.Threading;
public class Info : MarshalByRefObject
{
public void ShowCurrentCulture()
{
Console.WriteLine("Culture of {0} in application domain {1}: {2}",Thread.CurrentThread.Name,AppDomain.CurrentDomain.FriendlyName,CultureInfo.CurrentCulture.Name);
}
}
public class Example
{
public static void Main()
{
Info inf = new Info();
Thread.CurrentThread.Name = "MainThread";
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL");
inf.ShowCurrentCulture();
AppDomain ad = AppDomain.CreateDomain("Domain2");
Info inf2 = (Info)ad.CreateInstanceAndUnwrap(typeof(Info).Assembly.FullName, "Info");
inf2.ShowCurrentCulture();
Console.ReadLine();
}
}
/*
Culture of MainThread in application domain ConsoleApplication32.vshoot.exe : nl-NL
Culture of MainThread in application domain Domain2 : nl-NL