Set current thread name
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| C# Code Snippets |
| See also |
| edit |
This C# code snippet sets the name of the current thread by setting the Name property of the current thread.
class ThreadName { public static void Main() { Thread thread = Thread.CurrentThread; thread.Name = "CSharp-Online.NET Thread"; } }
| Thread.CurrentThread.Name (program output) |
| Name: CSharp-Online.NET Thread |