Freigeben über


ContextUtil.TransactionId-Eigenschaft

Ruft die GUID der aktuellen COM+-DTC-Transaktion ab.

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

Syntax

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

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

Eigenschaftenwert

Eine GUID, die ggf. die aktuelle COM+-DTC-Transaktion darstellt.

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 TransactionId-Eigenschaft abgerufen.

<Transaction(TransactionOption.Required)>  _
Public Class ContextUtil_TransactionId
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Display the ID of the transaction in which the current COM+ context
        ' is enlisted.
        MsgBox("Transaction ID: " & ContextUtil.TransactionId.ToString())

    End Sub 'Example
End Class 'ContextUtil_TransactionId
[Transaction(TransactionOption.Required)]
public class ContextUtil_TransactionId : ServicedComponent
{
    public void Example()
    {
        // Display the ID of the transaction in which the current COM+ context
        // is enlisted.
        Console.WriteLine("Transaction ID: {0}", ContextUtil.TransactionId);
    }
}
[Transaction(TransactionOption::Required)]
public ref class ContextUtil_TransactionId: public ServicedComponent
{
public:
   void Example()
   {
      // Display the ID of the transaction in which the current COM+ context
      // is enlisted.
      Console::WriteLine( "Transaction ID: {0}", ContextUtil::TransactionId );
   }
};
/** @attribute Transaction(TransactionOption.Required)
 */
public class ContextUtil_TransactionId extends ServicedComponent
{
    public void Example()
    {
        // Display the ID of the transaction in which the current COM+ context
        // is enlisted.
        Console.WriteLine("Transaction ID: {0}",
            ContextUtil.get_TransactionId());
    } //Example
} //ContextUtil_TransactionId

.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