- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
使用c#制做进程监视器(Using c# to make process monitor)
使用c#制做进程监视器(Using c# to make process monitor)
Using C# to make process monitor
1) use WMI to get the parent process ID, the process Creator
(note that the content obtained with WMI should not be recycled, which costs more.)
Add namespace:
Copy and save using System.Management;
Copy save summary
Use Wmi to obtain information about the creator of the specified process
Summary
Param name=pID process IDparam
Private void FillDetailUseWmi (int pID)
{
ManagementObjectSearcher searcher
= new ManagementObjectSearcher (Select, From, Win32_Process, Where, ProcessID= + pID);
ManagementObjectCollection MOC = searcher.Get ();
ManagementOperationObserver observer = new, ManagementOperationObserver ();
HandleObjectReady hor = new, HandleObjectReady ();
Monitoring if the asynchronous method has been successfully returned
Observer.ObjectReady = new ObjectReadyEventHandler (hor.Done);
Foreach (ManagementObject, Mo, in, MOC)
{
Asynchronously invokes the objects GetOwner method to obtain the process Creator
Mo.InvokeMethod (observer, GetOwner, null);
Waiting for asynchronous calls to return
While (... Hor.Complete)
{
System.Threading.Thread.Sleep (500);
}
String user =;
Determine whether the operation to obtain the user name is successful
(if) (hor.Obj[returnValue].ToString = 0)
{
User = hor.Obj.Properties[User].Value.ToString ();
}
Determine whether the item has been removed from the dictionary
If (... This.mDict.ContainsKey (pID))
{
Return;
}
If (mo[ParentProcessID]! = null this.mDict.ContainsKey (Convert.ToInt32 (mo[ParentProcessID])))
{
Gets the parent process name from the parent process ID
This.mDict[pID].ParentProce = this.mDict[Convert.ToInt32 (mo[ParentProcessID])].ProceName;
}
This.mDict[pID].Creator = user;
Trigger refresh process details event
If (this.HandleDetailList = = null)
{
This.HandleDetailList (this.mDict[pID]);
}
}
Releasing resources
Searcher.Dispose ();
Searcher = null;
Moc.Dispose ();
MOC = null;
Observer = null;
Hor = null;
}
Summary
This class is used to mo
您可能关注的文档
- 二级建造师装饰装修工程专业模拟试卷3(Two construction division decoration engineering professional simulation test paper 3).doc
- 二级建造师论文(Two stage constructor).doc
- 二级网页打不开处理方法(Two pages can not open the processing method).doc
- 二等水准测量数据(Two leveling data).doc
- 二级机电建造师——管道工程的分类和施工程序(Two grade mechanical and Electrical Engineer - Classification and construction procedure of piping engineering).doc
- 于亚东css视频目录().doc
- 云南白药深陷泄密门 背后存巨大利益链(Yunnan Baiyao deep leakage exist behind the great interests of the chain).doc
- 二胎备孕如何才能快速怀孕成功(How can a pregnant couple succeed in a fast pregnancy).doc
- 云南省鼓励创业贷免扶补政策(Yunnan encourage entrepreneurship loan free subsidy policy).doc
- 云南方言笑话(Jokes in Yunnan dialect).doc
- 使用eclipse开发php项目(Developing PHP projects using eclipse).doc
- 使用批处理自动安装网络打印机(Automatically install network printers using batch processing).doc
- 使用tune2fs将ext3转换为ext4(Using tune2fs to convert ext3 to ext4).doc
- 使用vb6(Using VB6).doc
- 使用新技巧 设计pcb时抗静电放电的方法(Method for designing antistatic discharge of PCB by using new technique).doc
- 使用数据sql(Using data SQL).doc
- 使用防火墙禁止端口法(Using the firewall inhibit port method).doc
- 供实时发放(For real-time release).doc
- 供应 原装usb手机万能数据线 万能数据线+万能充电线8p-b(Supply original USB mobile phone, universal data line, universal data line + universal charging line, 8p-b).doc
- 供应链节点企业的冲突及其管理(Conflicts and management of supply chain node enterprises).doc
最近下载
- 化学人教版九年级上册月考试卷.doc VIP
- 2025年价格鉴证师考试题库(附答案和详细解析)(0831).docx VIP
- 2025年价格鉴证师考试题库(附答案和详细解析)(0816).docx VIP
- 2025年价格鉴证师考试题库(附答案和详细解析)(1007).docx VIP
- T∕CNAEC 0602-2024 全过程工程咨询服务导则.pdf
- 2025年价格鉴证师考试题库(附答案和详细解析)(0817).docx VIP
- 铁路路基施工作业指导书(198页).doc VIP
- 2025年价格鉴证师考试题库(附答案和详细解析)(0912).docx VIP
- 2025年价格鉴证师考试题库(附答案和详细解析)(0815).docx VIP
- 2025年价格鉴证师考试题库(附答案和详细解析)(0901).docx VIP
原创力文档


文档评论(0)