AppDomain.CurrentDomain プロパティ
現在の Thread に対する現在のアプリケーション ドメインを取得します。
Public Shared ReadOnly Property CurrentDomain As AppDomain
[C#]
public static AppDomain CurrentDomain {get;}
[C++]
public: __property static AppDomain* get_CurrentDomain();
[JScript]
public static function get CurrentDomain() : AppDomain;
プロパティ値
現在のアプリケーション ドメイン。
使用例
Imports System
Imports System.Reflection
Imports System.Security.Policy 'for evidence object
Class ADSetupInformation
Public Shared Sub Main()
' Create the applcation domain setup information.
Dim domaininfo As New AppDomainSetup()
domaininfo.ApplicationBase = "file:///" + System.Environment.CurrentDirectory
'Create evidence for the new appdomain.
Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
' Create the new application domain using setup information.
Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo)
' Write out the application domain information.
Console.WriteLine(("Host domain: " + AppDomain.CurrentDomain.FriendlyName))
Console.WriteLine(("new child domain: " + domain.FriendlyName))
Console.WriteLine()
Console.WriteLine(("Application base is: " + domain.SetupInformation.ApplicationBase))
AppDomain.Unload(domain)
End Sub 'Main
End Class 'ADSetupInformation
[C#]
using System;
using System.Reflection;
using System.Security.Policy; //for evidence object
class ADSetupInformation
{
public static void Main()
{
//Create the application domain setup information.
AppDomainSetup domaininfo = new AppDomainSetup();
domaininfo.ApplicationBase = "file:///" + System.Environment.CurrentDirectory;
//Create evidence for new appdomain.
Evidence adevidence = AppDomain.CurrentDomain.Evidence;
// Create the new application domain using setup information.
AppDomain domain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo);
// Write out the application domain information.
Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName);
Console.WriteLine("new child domain: " + domain.FriendlyName);
Console.WriteLine();
Console.WriteLine("Application base is: " + domain.SetupInformation.ApplicationBase);
AppDomain.Unload(domain);
}
}
[C++]
#using <mscorlib.dll>
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Policy; //for evidence Object
int main() {
//Create the application domain setup information.
AppDomainSetup* domaininfo = new AppDomainSetup();
domaininfo->ApplicationBase = System::Environment::CurrentDirectory;
//Create evidence for new appdomain.
Evidence* adevidence = AppDomain::CurrentDomain->Evidence;
// Create the new application domain using setup information.
AppDomain* domain = AppDomain::CreateDomain(S"MyDomain", adevidence, domaininfo);
// Write Out the application domain information.
Console::WriteLine(S"Host domain: {0}", AppDomain::CurrentDomain->FriendlyName);
Console::WriteLine(S"new child domain: {0}", domain->FriendlyName);
Console::WriteLine();
Console::WriteLine(S"Application base is: {0}", domain->SetupInformation->ApplicationBase);
AppDomain::Unload(domain);
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ