다음을 통해 공유


AppDomain.ToString 메서드

응용 프로그램 도메인과 컨텍스트 정책의 이름이 들어 있는 문자열 표현을 가져옵니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overrides Function ToString As String
‘사용 방법
Dim instance As AppDomain
Dim returnValue As String

returnValue = instance.ToString
public override string ToString ()
public:
virtual String^ ToString () override
public String ToString ()
public override function ToString () : String

반환 값

리터럴 문자열 "이름:", 응용 프로그램 도메인의 이름 및 컨텍스트 정책의 문자열 표현 또는 "컨텍스트 정책이 없습니다." 문자열을 연결하여 구성되는 문자열입니다.

예외

예외 형식 조건

AppDomainUnloadedException

현재 AppDomain으로 표시된 응용 프로그램 도메인이 언로드된 경우

예제

Imports System
Imports System.Reflection
Imports System.Security.Policy
 'for evidence object

Class ADSetup
   
   Public Shared Sub Main()
      ' Create application domain setup information
      Dim domaininfo As New AppDomainSetup()
      
      'Create evidence for the new appdomain from evidence of the current application domain
      Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
      
      ' Create appdomain
      Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo)
      
      ' Write out application domain information
      Console.WriteLine(("Host domain: " + AppDomain.CurrentDomain.FriendlyName))
      Console.WriteLine(("child domain: " + domain.FriendlyName))
      Console.WriteLine(("child domain name using ToString:" + domain.ToString()))
      Console.WriteLine()
      
      AppDomain.Unload(domain)
   End Sub 'Main 
End Class 'ADSetup
using System;
using System.Reflection;
using System.Security.Policy;  //for evidence object
class ADSetup
{
    public static void Main()
    {
        // Create application domain setup information
        AppDomainSetup domaininfo = new AppDomainSetup();
        
        //Create evidence for the new appdomain from evidence of the current application domain
        Evidence adevidence = AppDomain.CurrentDomain.Evidence;

        // Create appdomain
        AppDomain domain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo);

        // Write out application domain information
        Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName);
        Console.WriteLine("child domain: " + domain.FriendlyName);
        Console.WriteLine("child domain name using ToString:" + domain.ToString());
        Console.WriteLine();
        
        AppDomain.Unload(domain);
    
    }
    
}
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Policy;

//for evidence Object*
int main()
{
   
   // Create application domain setup information
   AppDomainSetup^ domaininfo = gcnew AppDomainSetup;
   
   //Create evidence for the new appdomain from evidence of the current application domain
   Evidence^ adevidence = AppDomain::CurrentDomain->Evidence;
   
   // Create appdomain
   AppDomain^ domain = AppDomain::CreateDomain( "MyDomain", adevidence, domaininfo );
   
   // Write out application domain information
   Console::WriteLine( "Host domain: {0}", AppDomain::CurrentDomain->FriendlyName );
   Console::WriteLine( "child domain: {0}", domain->FriendlyName );
   Console::WriteLine( "child domain name using ToString: {0}", domain );
   Console::WriteLine();
   AppDomain::Unload( domain );
}
import System.*;
import System.Reflection.*;
import System.Security.Policy.*; //for evidence object

class ADSetup
{
    public static void main(String[] args)
    {
        // Create application domain setup information
        AppDomainSetup domainInfo = new AppDomainSetup();

        //Create evidence for the new appdomain from evidence of the 
        //current application domain
        Evidence adEvidence = AppDomain.get_CurrentDomain().get_Evidence();

        // Create appdomain
        AppDomain domain = AppDomain.CreateDomain("MyDomain", adEvidence, 
            domainInfo);

        // Write out application domain information
        Console.WriteLine("Host domain: " 
            + AppDomain.get_CurrentDomain().get_FriendlyName());
        Console.WriteLine("child domain: " + domain.get_FriendlyName());
        Console.WriteLine("child domain name using ToString:" 
            + domain.ToString());
        Console.WriteLine();
        AppDomain.Unload(domain);
    } //main 
} //ADSetup

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

AppDomain 클래스
AppDomain 멤버
System 네임스페이스