Possible Duplicate:
C#/.NET: How to get the thread id from a thread?
How I can get the same thread ID as I see it in Visual Studio?
I have tried to use Thread.CurrentThread.ManagedThreadId, but I am getting different numbers.
I am getting 35, 38, 39, etc., but in Visual Studio I have 10596, 893, etc…
Use GetCurrentThreadId() or ManagedThreadId() to get the thread ID:
Have a look at Stack Overflow question Getting the thread ID from a thread.