using System.Diagnostics;
...
WriteToEventViewer("MOSS-CRM Webservice", "Application", "User provided is invalid");
...
private void WriteToEventViewer(string sSource, string sLog, string sEvent)
{
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Warning, 234);
}
Also:
System.Diagnostics.EventLog eventLog = new System.Diagnostics.EventLog("Application");
eventLog.Source = "Rtws";
end
No comments:
Post a Comment