Freigeben über


ContextUtil.ActivityId-Eigenschaft

Ruft eine GUID ab, die die Aktivität darstellt, in der die Komponente enthalten ist.

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

Syntax

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

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

Eigenschaftenwert

Die GUID für eine Aktivität, wenn der aktuelle Kontext Teil der Aktivität ist, andernfalls GUID_NULL.

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 der Wert einer ActivityId-Eigenschaft abgerufen.

<Synchronization(SynchronizationOption.Required)>  _
Public Class ContextUtil_ActivityId
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Display the ActivityID associated with the current COM+ context.
        MsgBox("Activity ID: " & ContextUtil.ActivityId.ToString())

    End Sub 'Example
End Class 'ContextUtil_ActivityId
[Synchronization(SynchronizationOption.Required)]
public class ContextUtil_ActivityId : ServicedComponent
{
    public void Example()
    {
        // Display the ActivityID associated with the current COM+ context.
        Console.WriteLine("Activity ID: {0}", ContextUtil.ActivityId);
    }
}
[Synchronization(SynchronizationOption::Required)]
public ref class ContextUtil_ActivityId: public ServicedComponent
{
public:
   void Example()
   {
      // Display the ActivityID associated with the current COM+ context.
      Console::WriteLine( "Activity ID: {0}", ContextUtil::ActivityId );
   }
};
/** @attribute Synchronization(SynchronizationOption.Required)
 */
public class ContextUtil_ActivityId extends ServicedComponent
{
    public void Example()
    {
        // Display the ActivityID associated with the current COM+ context.
        Console.WriteLine("Activity ID: {0}", ContextUtil.get_ActivityId());
    } //Example
} //ContextUtil_ActivityId

.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