using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List<string> ul = new List<string>();
Process[] procs = Process.GetProcesses();
int u = 0;
foreach (Process proc in procs)
{
ul[u] = proc.ProcessName;
u++;
}
}
}
}
每次执行循环时,我都想将每个进程名称移动到我的数组列表中,但我遇到了出站异常。请提供一些示例代码。提前致谢...