WebThreadInformation.ThreadID Propriedade

Definição

Obtém o identificador atual da thread.

public:
 property int ThreadID { int get(); };
public int ThreadID { get; }
member this.ThreadID : int
Public ReadOnly Property ThreadID As Integer

Valor de Propriedade

O identificador de thread atual.

Exemplos

O seguinte exemplo de código mostra como obter o identificador de thread.

// Get the task Id.
public string GetThreadId()
{
    // Get the request principal.
    return (string.Format(
        "Thread Id: {0}",
        ThreadInformation.ThreadID.ToString()));
}
' Get the task Id.
Public Function GetThreadId() As String
   ' Get the request principal.
     Return String.Format( _
     "Thread Id: {0}", _
     ThreadInformation.ThreadID.ToString())
End Function 'GetThreadId

Observações

Mesmo que os threads geridos possam não ter mapeamento direto para os threads do SO, para efeitos de depuração é sempre útil isolar um thread específico onde possam existir problemas.

Aplica-se a