Gets the current application domain for the current Thread. : AppDomain « Reflection « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# / C Sharp » Reflection » AppDomainScreenshots 
Gets the current application domain for the current Thread.
  

using System;
using System.Reflection;
using System.Security.Policy;  

class ADSetupInformation
{
  public static void Main()
  {
    AppDomainSetup domaininfo = new AppDomainSetup();
    domaininfo.ApplicationBase = System.Environment.CurrentDirectory;
    Evidence adevidence = AppDomain.CurrentDomain.Evidence;
    AppDomain domain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo);

        Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName);
        Console.WriteLine("new child domain: " + domain.FriendlyName);
        Console.WriteLine("Application base is: " + domain.SetupInformation.ApplicationBase);
    AppDomain.Unload(domain);
  }
}

   
    
  
Related examples in the same category
1.Get AppDomainSetup
2.Assembly loaded event
3.AppDomain.AssemblyResolve Event
4.Gets the base directory that the assembly resolver uses to probe for assemblies.
5.Resets the path that specifies the location of private assemblies to the empty string ("").
6.Creates a new instance of a specified COM type.
7.Creates a new instance of the specified type.
8.Creates a new instance of the specified type defined in the specified assembly file.
9.Defines a dynamic assembly using the specified name, access mode, and storage directory.
10.Gets the friendly name of this application domain.
11.Gets the assemblies that have been loaded into the execution context of this application domain.
12.Loads an Assembly given its AssemblyName.
13.Returns the assemblies that have been loaded into the reflection-only context of the application domain.
14.Establishes security policy level for application domain.
15.Assigns the specified value to the specified application domain property.
16.Get App Setting String
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.