Compartir vía


WebThreadInformation.ThreadID Propiedad

Definición

Obtiene el identificador del subproceso actual.

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

Valor de propiedad

Int32

Identificador del subproceso actual.

Ejemplos

En el ejemplo de código siguiente se muestra cómo obtener el identificador del subproceso.

// 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

Comentarios

Incluso si es posible que los subprocesos administrados no tengan una asignación directa a los subprocesos del sistema operativo, para fines de depuración, siempre es útil aislar un subproceso específico en el que puedan existir problemas.

Se aplica a