Freigeben über


ContextUtil.ContextId-Eigenschaft

Ruft eine GUID für den aktuellen Kontext ab.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

Syntax

'Declaration
Public Shared ReadOnly Property ContextId As Guid
'Usage
Dim value As Guid

value = ContextUtil.ContextId
public static Guid ContextId { get; }
public:
static property Guid ContextId {
    Guid get ();
}
/** @property */
public static Guid get_ContextId ()
public static function get ContextId () : Guid

Eigenschaftenwert

Die GUID für den aktuellen Kontext.

Ausnahmen

Ausnahmetyp Bedingung

COMException

Es ist kein COM+-Kontext verfügbar.

PlatformNotSupportedException

Die Plattform ist nicht Windows 2000 oder höher.

Beispiel

Im folgenden Codebeispiel wird die Verwendung dieses Attributs veranschaulicht.

Protected Overrides Sub Activate() 
    MessageBox.Show(String.Format("Now entering..." + vbLf + "Application: {0}" + vbLf + "Instance: {1}" + vbLf + "Context: {2}" + vbLf, ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(), ContextUtil.ContextId.ToString()))

End Sub 'Activate
protected override void Activate()
{
    MessageBox.Show( String.Format("Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n",
                                   ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(),
                                   ContextUtil.ContextId.ToString() ) );
}
protected:
   virtual void Activate() override
   {
      MessageBox::Show( String::Format( "Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n", ContextUtil::ApplicationId.ToString(), ContextUtil::ApplicationInstanceId.ToString(), ContextUtil::ContextId.ToString() ) );
   }
protected void Activate()
{
    MessageBox.Show(String.Format("Now entering...\nApplication: {0}\n"
        + "Instance: {1}\nContext: {2}\n",
        ContextUtil.get_ApplicationId().ToString(),
        ContextUtil.get_ApplicationInstanceId().ToString(),
        ContextUtil.get_ContextId().ToString()));
} //Activate

.NET Framework-Sicherheit

  • Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ContextUtil-Klasse
ContextUtil-Member
System.EnterpriseServices-Namespace