ContextUtil.ActivityId Eigenschap
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee haalt u een GUID op die de activiteit vertegenwoordigt die het onderdeel bevat.
public:
static property Guid ActivityId { Guid get(); };
public static Guid ActivityId { get; }
static member ActivityId : Guid
Public Shared ReadOnly Property ActivityId As Guid
Waarde van eigenschap
De GUID voor een activiteit als de huidige context deel uitmaakt van een activiteit; anders, GUID_NULL.
Uitzonderingen
Er is geen COM+-context beschikbaar.
Voorbeelden
In het volgende codevoorbeeld wordt de waarde van een ActivityId eigenschap opgehaald.
[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 );
}
};
[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