获取当前线程id
转:https://www.cnblogs.com/comsky/p/6020327.html
如果获得当前进程的Id用:
Process[] processes = Process.GetProcesses();
foreach(Process process in processes)
{
if(process.ProcessName == "进程名"
{
MessageBox.Show(process.Id);
}
}
Process processes =Process.GetCurrentProcess
processes.id获得当前进程的ID
如果获得当前线程的ID用:
Thread.CurrentThread.ManagedThreadId.ToString() (推荐)
或
AppDomain.GetCurrentThreadId().ToString()
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html