Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass
- {
- public ManagementEventWatcher mywatch;
- public start(){
- string queryString =
- "SELECT TargetInstance.Name FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA 'Win32_Process'";
- // The dot in the scope means use the current machine
- string scope = @"\\.\root\CIMV2";
- // Create a watcher and listen for events
- this.watch = new ManagementEventWatcher(scope, queryString);
- this.watch.EventArrived += ProcessStarted;
- this.watch.Start();
- MessageBox.Show("log startet");
- }
- public stop(){
- this.watch.stop()
- }
- }
- m = MyClass()
- m.start()
- m.setmytimer(10minutes)
- m.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement