代码
StringBuilder sb
=
new
StringBuilder();
EventLog mylog = new EventLog();
mylog.Log = " Application " ; // System[系统日志] | Application[应用日志] | Security[安全日志]
EventLogEntryCollection myCollection = mylog.Entries;
for ( int i = 0 ; i < myCollection.Count; i ++ )
{
sb.Append( " Time: " + myCollection[i].TimeGenerated + " " +
myCollection[i].Message + " <br /> " );
}
EventLog mylog = new EventLog();
mylog.Log = " Application " ; // System[系统日志] | Application[应用日志] | Security[安全日志]
EventLogEntryCollection myCollection = mylog.Entries;
for ( int i = 0 ; i < myCollection.Count; i ++ )
{
sb.Append( " Time: " + myCollection[i].TimeGenerated + " " +
myCollection[i].Message + " <br /> " );
}