代码如下:
代码
#region 取得windows的所有进程
public static string GetCourse()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string tempName = "" ;
int begpos, endpos;
foreach (Process thisProc in System.Diagnostics.Process.GetProcesses())
{
tempName = thisProc.ToString();
begpos = tempName.IndexOf( " ( " ) + 1 ;
endpos = tempName.IndexOf( " ) " );
tempName = tempName.Substring(begpos, endpos - begpos);
sb.Append(tempName + " <br /> " );
}
return sb.ToString();
}
#endregion
本文转自王磊的博客博客园博客,原文链接:http://www.cnblogs.com/vipstone/archive/2010/11/23/1885387.html,如需转载请自行联系原作者