Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace LoggingTest
- {
- class Program
- {
- static void Main(string[] args)
- {
- string sSource;
- string sLog;
- string sEvent;
- sSource = "dotNET Sample App";
- sLog = "Application";
- sEvent = "Sample Event,What's the fuck!";
- if (!EventLog.SourceExists(sSource))
- EventLog.CreateEventSource(sSource, sLog);
- EventLog.WriteEntry(sSource, sEvent);
- EventLog.WriteEntry(sSource, sEvent,
- EventLogEntryType.Warning, 234);
- // and then we can see log in Windows Event Viewer
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement