방법: 관리 코드에 스레드 이름 설정
업데이트: 2007년 11월
이 항목은 다음 언어에 적용됩니다.
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
![]() |
![]() |
![]() |
![]() |
Standard |
![]() |
![]() |
||
Pro 및 Team |
![]() |
표의 범례:
![]() |
해당 |
![]() |
해당 없음 |
![]() |
명령은 기본적으로 숨겨져 있습니다. |
관리 코드에 스레드 이름을 설정하려면 [System.Threading.Thread.Name] 속성을 사용합니다.
예제
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