Esempio n. 1
0
        void testEvent()
        {
            String wql = "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance isa \"Win32_Process\"";
            wql = "SELECT * FROM __InstanceOperationEvent WITHIN 10 WHERE TargetInstance ISA 'Win32_ComputerSystem' ";
            wql += " OR  TargetInstance ISA 'Win32_OperatingSystem' ";
            wql += " OR  TargetInstance ISA 'Win32_Session' ";
            wql += " OR  TargetInstance ISA 'Win32_LogonSession' ";
            //wql += " OR  TargetInstance ISA 'Win32_NTLogEvent' ";
            //wql += " OR  TargetInstance ISA 'CCM_ComputerSystem' ";
            //wql += " OR  TargetInstance ISA 'CIM_ComputerSystem' ";

            wql = "SELECT * FROM __InstanceModificationEvent WITHIN 5 WHERE TargetInstance ISA \"Win32_Session\"";

            EventWatcherAsync watcher = new EventWatcherAsync(wql);
            //EventWatcherPolling.Run();
        }
        void testEvent()
        {
            String wql = "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance isa \"Win32_Process\"";

            wql  = "SELECT * FROM __InstanceOperationEvent WITHIN 10 WHERE TargetInstance ISA 'Win32_ComputerSystem' ";
            wql += " OR  TargetInstance ISA 'Win32_OperatingSystem' ";
            wql += " OR  TargetInstance ISA 'Win32_Session' ";
            wql += " OR  TargetInstance ISA 'Win32_LogonSession' ";
            //wql += " OR  TargetInstance ISA 'Win32_NTLogEvent' ";
            //wql += " OR  TargetInstance ISA 'CCM_ComputerSystem' ";
            //wql += " OR  TargetInstance ISA 'CIM_ComputerSystem' ";

            wql = "SELECT * FROM __InstanceModificationEvent WITHIN 5 WHERE TargetInstance ISA \"Win32_Session\"";

            EventWatcherAsync watcher = new EventWatcherAsync(wql);
            //EventWatcherPolling.Run();
        }
Esempio n. 3
0
 public static void Main(string[] args)
 {
     // start the event watcher
     EventWatcherAsync eventWatcher = new
                                      EventWatcherAsync();
 }