Get name of current AppDomain and context ID : Context : Development C# Examples


C# Examples » Development » Context »

 

Get name of current AppDomain and context ID









    
using  System;
using  System.Threading;

class  MainClass
{
    //  [MTAThread]
    [STAThread]
    static  void  Main(string[]  args)
    {
        Thread  primaryThread  =  Thread.CurrentThread;

        primaryThread.Name  =  "ThePrimaryThread";

        Console.WriteLine("Name  of  current  AppDomain:  {0}",  Thread.GetDomain().FriendlyName);
        Console.WriteLine("ID  of  current  Context:  {0}",  Thread.CurrentContext.ContextID);
    }
}
    
   
  
   



Output

Name of current AppDomain: main.exe
ID of current Context: 0


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Context