C#列出当前系统所有正在运行的程序

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

C#列出当前系统所有正在运行的程序

Using System.Diagnostics;
  
foreach (Process p in Process.GetProcesses (System.Environment.MachineName))
{
    if (p.MainWindowHandle! = IntPtr.Zero)
    {
        // Display the user name of the program
        Console.WriteLine (p); / / string s = p.ToString ();
    }
}