EventViewer using

G

Guest

i have 2 questions :
1)i tried to use this code :
Public Sub Write2EventViewer(ByVal errorMessage As String)

Dim strSource As String = "MyWebSite" 'name of the source
Dim strLogType As String = "Application" 'type of the log 'Application
Dim strMachine As String = "." ' //machine name


If EventLog.SourceExists(strSource, strMachine) = False Then

System.Diagnostics.EventLog.CreateEventSource(strSource,
strLogType)

End If
Dim MyLog As New EventLog(strLogType, ".", strSource)

MyLog.WriteEntry(errorMessage, EventLogEntryType.Warning)
End Sub

in the begining i assume i did some mistake and now the error instead of
appearing under Application ,with source=MyWebSite
i have a new log EVENT under application which called MyWebSite
and the error are written to there.
how can i fix this so it will appear under application?
2)how can i create a dll from this code and use it in my asp.net web site
project?

thnaks in advnace
peleg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top