Advertisement
tankcr

Untitled

Jun 4th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Diagnostics;
  7.  
  8. namespace SysTools
  9. {
  10. public class Logs
  11. {
  12. string logName;
  13.  
  14. public string LogName
  15. {
  16. get { return logName; }
  17. set { logName = value; }
  18. }
  19.  
  20. public Logs()
  21. {
  22.  
  23. }
  24. }
  25. public class GetLogs
  26. {
  27. public static List<Logs> GetLogNames(string computername)
  28. {
  29. List<Logs> logs = new List<Logs>();
  30. GetLogs LogNames = new GetLogs();
  31. EventLog[] remoteEventLogs;
  32. remoteEventLogs = EventLog.GetEventLogs(computername);
  33. foreach (EventLog e in remoteEventLogs) { logs.Add(e.LogDisplayName); }
  34. return logs;
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement