本文介绍了64位窗口中的应用程序列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Helllllooo ....
我只想在用户运行应用程序时创建一个事件...
那就是我从这里得到的...

Helllllooo....
I just want to create a event whenever user runs an application...
for thats what I''ve got from here...

public partial class Form1 : Form
    {
        public System.Management.ManagementEventWatcher mgmtWtch;
 
        public Form1()
        {
            InitializeComponent();
            mgmtWtch = new System.Management.ManagementEventWatcher("Select * From Win32_ProcessStartTrace");
            mgmtWtch.EventArrived += new System.Management.EventArrivedEventHandler(mgmtWtch_EventArrived);
            mgmtWtch.Start();
        }
 
        private void mgmtWtch_EventArrived(object sender, System.Management.EventArrivedEventArgs e)
        {
            MessageBox.Show((string)e.NewEvent["ProcessName"]);
        }       
    }



在32位窗口中可以正常工作,但在64位窗口中却无法工作,但出现了访问被拒绝"的异常
感谢



which is working fine in 32bit windows but I didn''t work on 64 bit window gives an exception of "Access Denied"
thanks

推荐答案


这篇关于64位窗口中的应用程序列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 00:41