⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 allprocess.cs

📁 解压包里的是用C#写的100个例子
💻 CS
字号:
using System; 
using System.Diagnostics;

public class AllProcess
{ 
    public AllProcess()
    { 
        // 
        // TODO: Add Constructor Logic here 
        // 
    }

    public static int Main(string[] args) 
    { 
        // 构造进程数组
        Process[] procList = new Process[100]; 
        
        // 得到所有的进程
        procList = Process.GetProcesses(); 
        
        // 打印前20个进程的进程名称和ID号
        for ( int i=0; i<20; i++)         
        {         
            string strProcName = procList[i].ProcessName; 
            int iProcID = procList[i].Id;
            Console.WriteLine(strProcName + " : " + iProcID);
        } 

        return 0; 
    } 
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -