Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Capture system Events

Capture system Events

Scheduled Pinned Locked Moved C#
csharphelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jijo BP
    wrote on last edited by
    #1

    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#

    H 1 Reply Last reply
    0
    • J Jijo BP

      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#

      H Offline
      H Offline
      HakunaMatada
      wrote on last edited by
      #2

      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!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups