WebThreadInformation.ThreadID Eigenschap

Definitie

Hiermee haalt u de huidige thread-id op.

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

Waarde van eigenschap

De huidige thread-id.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u de thread-id kunt ophalen.

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

Opmerkingen

Zelfs als beheerde threads mogelijk geen directe toewijzing hebben aan de besturingssysteemthreads, is het voor foutopsporing altijd handig om een specifieke thread te isoleren waarin problemen kunnen bestaan.

Van toepassing op