代码如下:
代码
#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