문제

I currently spend a considerable amount of time copying and pasting event viewer logs into text files and then copying them to a repository on another computer.

Is it possible to automate the saving these event viewer logs between a specified date/time to the computer (so that they can then be copied to the repository).

Ideally, if it's possible, it has to be achieved by C# .NET code.

The purpose of this is for automated tests, which run on Windows Server 2003/2008 machines.

Thank you

도움이 되었습니까?

해결책

EventLog.GetEventLogs will get you the logs, you can then loop throught them and write to a text file. The example here will get you started.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top