ContextUtil.ActivityId Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a GUID representing the activity containing the component.
public:
static property Guid ActivityId { Guid get(); };
C#
public static Guid ActivityId { get; }
static member ActivityId : Guid
Public Shared ReadOnly Property ActivityId As Guid
The GUID for an activity if the current context is part of an activity; otherwise, GUID_NULL
.
There is no COM+ context available.
The following code example gets the value of a ActivityId property.
[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 );
}
};
C#
[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 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
End Class
Proizvod | Verzije |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Surađujte s nama na GitHubu
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.
Povratne informacije o proizvodu .NET
.NET je projekt otvorenog koda. Odaberite vezu za slanje povratnih informacija: