确定进程是属于用户,系统还是与操作系统相关(C#,最有可能是WMI) [英] Determining if a process belongs to User, System or is OS related (C#, Most likely WMI)
问题描述
我正在尝试使用WMI使用Windows窗体应用程序监视Windows系统上的所有进程. 我想知道哪个进程是系统进程,哪个是用户进程(例如taskmanager中的用户名).这是相当可搜索的,但我还需要知道哪些与Windows相关,哪些与Windows不相关.我找不到我需要的东西.
假设我的Windows用户名是"USER_A"; "winamp.exe"的所有者/用户名为"USER_A".但是"taskmgr.exe","dwm.exe"等也具有相同的用户名.乍一看,该进程(WMI,Win32_Process,ExecutablePath)的路径是独特的,因为与Windows相关的进程位于"C:\ Windows","C:\ Windows \ System32"下,但是还有更好的方法吗?还有那些不需要太复杂(需要长时间处理)的查询.
预先感谢.
Hi,
I''m trying to monitor all the processes on a windows system with my windows forms application using WMI. I want to know which process'' are system process, which are user process(like the username in taskmanager). This is quite googleable but i also need to know which are related to windows and which are not. I haven''t been able to find what i needed.
Assume my windows user name is "USER_A"; "winamp.exe" has the owner/user name as "USER_A". But "taskmgr.exe", "dwm.exe", etc also has the same user name. At first glance, path for the process (WMI, Win32_Process, ExecutablePath) is distinctive since Windows related processes are under "C:\Windows", "C:\Windows\System32" but is there any better way? Also the ones that wont need too complex(long to process) queries.
Thanks in advance.
推荐答案
您是对的,可以使用WMI来完成.请参阅:
http://stackoverflow.com/questions/777548/how-do-i-determine-the-owner-of-a-process-in-c [
You are right, it can be done with WMI. Please see:
http://stackoverflow.com/questions/777548/how-do-i-determine-the-owner-of-a-process-in-c[^].
—SA
这篇关于确定进程是属于用户,系统还是与操作系统相关(C#,最有可能是WMI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!