对系统进程操作

    技术2022-05-11  12

    获得当前计算机系统内所有的已启动的进程:System.Diagnostics.Process[] processOnComputer = System.Diagnostics.Process.GetProcesses();foreach ( System.Diagnostics.Process p in processOnComputer ){System.Console.WriteLine(p.ToString());}Console.ReadLine();

    获得当前计算机系统内某个进程并关闭:

    System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("进程名称");foreach ( System.Diagnostics.Process p in process){p.Kill();}


    最新回复(0)