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. Event log query... very odd!

Event log query... very odd!

Scheduled Pinned Locked Moved C#
databasesysadminquestion
3 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.
  • L Offline
    L Offline
    lane0p2
    wrote on last edited by
    #1

    Hi All, i have a code (below), it take 2 variables, the first being the server name and the second being the eventID to look for in the Directory Service eventlog. it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!! any ideas? EventLog el = new EventLog("Directory Service", args[0].ToString()); foreach(EventLogEntry i in el.Entries) { if(Convert.ToInt32(i.EventID) == Convert.ToInt32(args[1])) { Console.WriteLine(i.EventID.ToString() + " - " + i.TimeWritten.ToShortDateString()); } }

    M 1 Reply Last reply
    0
    • L lane0p2

      Hi All, i have a code (below), it take 2 variables, the first being the server name and the second being the eventID to look for in the Directory Service eventlog. it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!! any ideas? EventLog el = new EventLog("Directory Service", args[0].ToString()); foreach(EventLogEntry i in el.Entries) { if(Convert.ToInt32(i.EventID) == Convert.ToInt32(args[1])) { Console.WriteLine(i.EventID.ToString() + " - " + i.TimeWritten.ToShortDateString()); } }

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      lane0p2 wrote:

      it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!!

      Probably, there is no event for this id :^)

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      L 1 Reply Last reply
      0
      • M Manas Bhardwaj

        lane0p2 wrote:

        it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!!

        Probably, there is no event for this id :^)

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        L Offline
        L Offline
        lane0p2
        wrote on last edited by
        #3

        there is!! i was looking at the eventviewer and ended up testing loads of ID but only 1394 failed. i just can't figure it out!

        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