Procedura: impostare il nome di un thread in codice gestito
Aggiornamento: novembre 2007
Le informazioni contenute in questo argomento sono valide per:
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
![]() |
![]() |
![]() |
![]() |
Standard |
![]() |
![]() |
||
Pro e Team |
![]() |
Legenda tabella:
![]() |
Applicabile |
![]() |
Non applicabile |
![]() |
Comando o comandi nascosti per impostazione predefinita. |
Per impostare il nome di un thread in codice gestito, utilizzare la proprietà [System.Threading.Thread.Name].
Esempio
Public Class Needle
' This method will be called when the thread is started.
Sub Baz()
Console.WriteLine("Needle Baz is running on another thread")
End Sub
End Class
Sub Main()
Console.WriteLine("Thread Simple Sample")
Dim oNeedle As New Needle()
' Create a Thread object.
Dim oThread As New System.Threading.Thread(AddressOf oNeedle.Baz)
' Set the Thread name to "MainThread".
oThread.Name = "MainThread"
' Starting the thread invokes the ThreadStart delegate
oThread.Start()
End Sub
Vedere anche
Attività
Procedura: impostare il nome di un thread in codice nativo