DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   Code Snippet: Writing to EventLog - Shalvin (http://www.daniweb.com/forums/thread217051.html)

Shalvin Mar 31st, 2008 2:20 am
Writing to EventLog - Shalvin
 
EventViewer can be accessed by Selecting Event Viewer from Administrative Tools of Control Panel. This code snippet will add an Entry called Shalvin inside the Application section.

  1. using System.Diagnostics;
  2.  
  3. private void Form1_Load(object sender, EventArgs e)
  4. {
  5. EventLog evlog = new EventLog("Application");
  6. evlog.Source = "Shalvin";
  7. evlog.WriteEntry("Shalvin.com", EventLogEntryType.Information);
  8. }

All times are GMT -4. The time now is 9:36 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC