Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Diagnostics;
- namespace SysTools
- {
- public class Logs
- {
- string logName;
- public string LogName
- {
- get { return logName; }
- set { logName = value; }
- }
- public Logs()
- {
- }
- }
- public class GetLogs
- {
- public static List<Logs> GetLogNames(string computername)
- {
- List<Logs> logs = new List<Logs>();
- GetLogs LogNames = new GetLogs();
- EventLog[] remoteEventLogs;
- remoteEventLogs = EventLog.GetEventLogs(computername);
- foreach (EventLog e in remoteEventLogs) { logs.Add(e.LogDisplayName); }
- return logs;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement