title: Read Event Log From Newest to Oldest
body: <p>I have written a short program to establish the uptime for remote PC's using the event log messages which are posted at startup and shutdown. Currently the logic is :</p>
  
  <pre><code>  foreach (eventlogentry)
    {
         if (entryTime &gt; OldestTime)
         {
              if (entry = Startup)
              {
                   addOnTime(entry.Time);
              }
              if (entry = Shutdown)
              {
                   addOffTime(entry.Time);
              }
         }
    }
  </code></pre>
  
  <p>"OldestTime" define how far to scan backwards in time....</p>
  
  <p>I would like to know if there is anyway to easily ammend my program to read the events from newest to oldest? </p>
  
  <p>It's reading remote event logs and its taking a while for this function to run, as it starts at the end and reads forward. </p>
  
  <p>I know this because I added a "else" block to the first "if" to break out of the foreach block, if the entry isnt within the timespan we are looking for and the program stop's at the first event it reads.</p>