Clearing an Event Log

Team-Fly    

 
Visual Basic .NET Unleashed
By Paul Kimmel
Table of Contents
Chapter 20.  Writing to the Event Log

Clearing an Event Log

You can use the EventLog.Clear instance method to clear an event log. You are likely to want to do this when writing a custom event log, where a lot of procedural-level entries might fill up the log. The following fragment demonstrates how to clear a specific log:

 Dim Log As New EventLog("Application") Log.Clear() 

Log.Clear requires no parameters because it's an instance method. The EventLog instance knows which log it's associated with.


Team-Fly    
Top
 


Visual BasicR. NET Unleashed
Visual BasicR. NET Unleashed
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 222

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net