获取在os中打开的应用程序Windows列表。 [英] Get list of application Windows opened in os.

查看:114
本文介绍了获取在os中打开的应用程序Windows列表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我要求显示所有在os中打开的应用程序列表,就像任务管理器Application Tab列出所有应用程序一样。我尝试使用system.Diagnostic来打开所有当前进程,但是当我打开多个ms字窗口时,我只得到ms字的一个进程,任何人都可以帮我解决这个问题。

Hi,
i have requirement to display all the list of applications are open in os, as like task manager Application Tab is listing all application. i tried with the system.Diagnostic to get the all the current processes opened but when i opened multiple ms word windows i am getting only one process as of ms word, can any one help me to over come this problem.

推荐答案

Process[] p = Process.GetProcesses();

foreach(Process p1 in p){
Console.WriteLine("Process: {0} ID: {1}", p1.ProcessName, p1.Id);
}


这篇关于获取在os中打开的应用程序Windows列表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆