Partilhar via


ContextUtil.ApplicationInstanceId Propriedade

Definição

Obtém um GUID para a instância atual do aplicativo.

public:
 static property Guid ApplicationInstanceId { Guid get(); };
public static Guid ApplicationInstanceId { get; }
static member ApplicationInstanceId : Guid
Public Shared ReadOnly Property ApplicationInstanceId As Guid

Valor da propriedade

O GUID da instância do aplicativo atual.

Exceções

Não há contextos de COM+ disponíveis.

A plataforma não é Windows XP ou posterior.

Exemplos

O exemplo de código a seguir obtém o valor de uma ApplicationInstanceId propriedade .

[Synchronization(SynchronizationOption::Required)]
public ref class ContextUtil_ApplicationInstanceId: public ServicedComponent
{
public:
   void Example()
   {
      // Display the ApplicationInstanceId associated with the current COM+
      // context.
      Console::WriteLine( "Application Instance ID: {0}", 
         ContextUtil::ApplicationInstanceId );
   }
};
[Synchronization(SynchronizationOption.Required)]
public class ContextUtil_ApplicationInstanceId : ServicedComponent
{
    public void Example()
    {
        // Display the ApplicationInstanceId associated with the current COM+
        // context.
        Console.WriteLine("Application Instance ID: {0}",
            ContextUtil.ApplicationInstanceId);
    }
}
<Synchronization(SynchronizationOption.Required)>  _
Public Class ContextUtil_ApplicationInstanceId
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Display the ApplicationInstanceId associated with the current COM+
        ' context.
        MsgBox("Application Instance ID: " & ContextUtil.ApplicationInstanceId.ToString())

    
    End Sub
End Class

Aplica-se a