App Domain C# with Example



App Domain C# with Example

 using System;
using System.Linq;
using System.Diagnostics;
using System.Reflection;

namespace CSharpMultiThreading
{
	class ApplicationDomain
	{
		static void Main(string[] args)
		{
			DisplayDADStats();
		}
		
		public static void DisplayDADStats()
		{
			// Get access to the AppDomain for the current thread.
			AppDomain defaultAD = AppDomain.CurrentDomain;

			// Print out various stats about this domain.
			Console.WriteLine("Name of this domain: {0}", defaultAD.FriendlyName);
			Console.WriteLine("ID of domain in this process: {0}", defaultAD.Id);
			Console.WriteLine("Is this the default domain?: {0}",
			defaultAD.IsDefaultAppDomain());
			Console.WriteLine("Base directory of this domain: {0}", defaultAD.BaseDirectory);
		}
	}
}
 

0 Comment's

Comment Form