WebThreadInformation.ThreadID Property

 

Gets the current thread identifier.

Namespace:   System.Web.Management
Assembly:  System.Web (in System.Web.dll)

Public ReadOnly Property ThreadID As Integer

Property Value

Type: System.Int32

The current thread identifier.

Even if managed threads might not have direct mapping to the OS threads, for debugging purposes, it is always useful to isolate a specific thread where problems might exist.

The following code example shows how to get the thread identifier.

' 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

.NET Framework
Available since 2.0
Return to top
Show: