#region 取得windows的所有进程
public static string GetCourse()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string tempName = "";
int begpos, endpos;
foreach (System.Diagnostics.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
本文介绍了一个使用C#编程语言获取Windows系统中所有运行进程名称的方法,通过遍历Process类并提取进程名来实现。
561

被折叠的 条评论
为什么被折叠?



