Fork me on GitHub

asp.net 取windows的所有进程

代码如下:

 

代码
#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

 

posted @ 2010-11-23 13:56  磊哥|www.javacn.site  阅读(343)  评论(0编辑  收藏  举报