Thread.Name プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

スレッドの名前を含む文字列。名前が設定されていない場合は null 参照 (Visual Basic では Nothing)。



Imports System Imports System.Threading Public Class Name <MTAThread> _ Shared Sub Main() ' Check whether the thread has previously been named ' to avoid a possible InvalidOperationException. If Thread.CurrentThread.Name = Nothing Then Thread.CurrentThread.Name = "MainThread" Else Console.WriteLine("Unable to name a previously " & _ "named thread.") End If End Sub End Class
using System; using System.Threading; class Name { static void Main() { // Check whether the thread has previously been named // to avoid a possible InvalidOperationException. if(Thread.CurrentThread.Name == null) { Thread.CurrentThread.Name = "MainThread"; } else { Console.WriteLine("Unable to name a previously " + "named thread."); } } }
using namespace System; using namespace System::Threading; int main() { // Check whether the thread has previously been named to // avoid a possible InvalidOperationException. if ( Thread::CurrentThread->Name == nullptr ) { Thread::CurrentThread->Name = "MainThread"; } else { Console::WriteLine( "Unable to name a previously " "named thread." ); } }
import System.*; import System.Threading.*; import System.Threading.Thread; class Name { public static void main(String[] args) { // Check whether the thread has previously been named // to avoid a possible InvalidOperationException. if (Thread.get_CurrentThread().get_Name() == null) { Thread.get_CurrentThread().set_Name("MainThread"); } else { Console.WriteLine(("Unable to name a previously " + "named thread.")); } } //main } //Name

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Thread.Name プロパティのページへのリンク