Capture system Events
-
I want to capture all the system events in my machine. Please help me. Or can you conver this VBS file to c# strComputer = "." Set objWMIService = GetObject("winmgmts:\\" _ & strComputer & "\root\CIMV2") Set objEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM Win32_ProcessTrace WITHIN 10") Wscript.Echo "Waiting for events ..." i = 0 Do Until i=5 Set objReceivedEvent = objEvents.NextEvent 'report an event Wscript.Echo "Win32_ModuleTrace event occurred" & VBNewLine _ & "Process Name = " _ & objReceivedEvent.ProcessName & VBNewLine _ & "Process ID = " _ & objReceivedEvent.Processid & VBNewLine _ & "Session ID = " & objReceivedEvent.SessionID i = i+ 1 Loop Please help me Thanks in advance Jijo JIJO BABY - Lets Play C#
-
I want to capture all the system events in my machine. Please help me. Or can you conver this VBS file to c# strComputer = "." Set objWMIService = GetObject("winmgmts:\\" _ & strComputer & "\root\CIMV2") Set objEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM Win32_ProcessTrace WITHIN 10") Wscript.Echo "Waiting for events ..." i = 0 Do Until i=5 Set objReceivedEvent = objEvents.NextEvent 'report an event Wscript.Echo "Win32_ModuleTrace event occurred" & VBNewLine _ & "Process Name = " _ & objReceivedEvent.ProcessName & VBNewLine _ & "Process ID = " _ & objReceivedEvent.Processid & VBNewLine _ & "Session ID = " & objReceivedEvent.SessionID i = i+ 1 Loop Please help me Thanks in advance Jijo JIJO BABY - Lets Play C#
I think you can use the Windows Management Instrumentation classes of .NET to achieve it!
System.Management System.Management.Instrumentation
Try referring to this[^]. Hope this helps...:) --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!