if throw exception the following exception:
Cannot open log for source 'Security'. You may not have write access.
Nicholas Paldino [.NET/C# MVP] wrote:[color=blue]
> John,
>
> What happens when you try and write to the security event log? Do you
> get an exception or something of that nature? If so, what is it?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> -
mvp@spam.guard.caspershouse.com
>
> "John" <johnxhc@yahoo.com> wrote in message
> news:1146501188.315736.13980@v46g2000cwv.googlegro ups.com...[color=green]
> > Is there any special code I have to write to log event to Security
> > Event Log? The following code give me "Very Easy Question, How to
> > write log to SECURTY Event Log? Please help" Error
> >
> > // Create an EventLog instance and assign its source.
> > EventLog myLog = new EventLog();
> > myLog.Source = "Security";
> >
> > // Write an informational entry to the event log.
> > myLog.WriteEntry("Writing warning to event log.",
> > EventLogEntryType.Warning);
> >
> >
> > but as soon as I change "Security" to "Application" ,
> > everything works fine
> >
> > // Create an EventLog instance and assign its source.
> > EventLog myLog = new EventLog();
> > myLog.Source = "Application";
> >
> > // Write an informational entry to the event log.
> > myLog.WriteEntry("Writing warning to event log.",
> > EventLogEntryType.Warning);
> >
> >
> > Any ideas?
> > Thanks in advance
> > John
> >[/color][/color]