October 2001
Intermediate to advanced
376 pages
7h 3m
English
The event log interface in the System.Diagnostics namespace is very feature-complete; this namespace is the one discussed and used in all the code examples in this chapter. Despite its extra features, the EventLog object in the System.Diagnostics namespace is quite easy to manipulate and use. To write a message to the Windows 2000 Event Log, simply call the static WriteEntry method of the EventLog class as illustrated in Listings 8.1 and 8.2.
<%@ Page Language="C#" %> <%@ Import Namespace="System.Diagnostics" %> <% EventLog.WriteEntry("EventTest", "I'm a little teapot, short and stout."); Response.Write("Done!"); ... |
Read now
Unlock full access