1。获取进程Id,进程名字。

代码
          using System.Diagnostics;
            //获取电脑当前运行的进程
            Process[] myProcesses;
            //Get the list of current active processes.
            myProcesses = System.Diagnostics.Process.GetProcesses();
            //Grab some basic information for each process.
            Process myProcess;
            int pId;
            string pName;
            int pCount = myProcesses.Length;
            for (int i = 0; i < pCount; i++)
            {
                myProcess = myProcesses[i];
                pId = myProcess.Id;
                pName = myProcess.ProcessName;                           
            }           

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-10-16
  • 2021-12-27
  • 2021-10-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-10-12
相关资源
相似解决方案