I\'m trying to use the EventLogQuery class to query the eventlog. I followed the example shown on http://msdn.microsoft.com/en-us/library/bb671200%28v=vs.90%29.aspx#Y0.
Here is another C# for initializing an EventLogQuery object that will load event entires for a specific date range
var startTime = DateTime.Now.AddDays(-1);
var endTime = DateTime.Now;
var query = string.Format("*[System[TimeCreated[@SystemTime >= '{0}']]] and *[System[TimeCreated[@SystemTime <= '{1}']]]",
startTime.ToUniversalTime().ToString("o"),
endTime.ToUniversalTime().ToString("o"));
var elq = new EventLogQuery("Applicaton", PathType.LogName, query);