get/set thread name
Published: 3. November 2011 | Updated: 3. November 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Threading
Tags: C# Threading
Import namespace
using System.Threading;
Code
Thread thread = Thread.CurrentThread; // set thread name thread.Name = "Test"; // get thread name string threadName = thread.Name; Console.WriteLine(threadName);Console Output:
Test
| Send us feedback about this snippet » |





