Thread::GetDomainID Method ()
.NET Framework (current version)
Returns a unique application domain identifier.
Assembly: mscorlib (in mscorlib.dll)
Return Value
Type: System::Int32A 32-bit signed integer uniquely identifying the application domain.
The following code example shows how to retrieve the name and ID of the AppDomain in which the thread is running.
using namespace System; using namespace System::Threading; ref class Test { private: Test(){} public: static void ThreadMethod() { Console::WriteLine( "Thread {0} started in {1} with AppDomainID = {2}.", AppDomain::GetCurrentThreadId().ToString(), Thread::GetDomain()->FriendlyName, Thread::GetDomainID().ToString() ); } }; int main() { Thread^ newThread = gcnew Thread( gcnew ThreadStart( &Test::ThreadMethod ) ); newThread->Start(); }
.NET Framework
Available since 1.1
Available since 1.1
Show: