G
Guest
I would like to write to the EventLog (Application) with following code. But
this works only under admin account. There are no restrictions in the
WriteEntry-documentation.
Can anyone help me?
Thanks in advance!
try
{
EventLog eLog = null;
bool bLäuft = true;
if(!EventLog.SourceExists("XXX")) EventLog.CreateEventSource"XXX", "",".");
eLog = new EventLog();
eLog.Log = "";
eLog.Source = "XXX";
if (bLäuft == true) eLog.WriteEntry("läuft",EventLogEntryType.Information,1);
eLog.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
this works only under admin account. There are no restrictions in the
WriteEntry-documentation.
Can anyone help me?
Thanks in advance!
try
{
EventLog eLog = null;
bool bLäuft = true;
if(!EventLog.SourceExists("XXX")) EventLog.CreateEventSource"XXX", "",".");
eLog = new EventLog();
eLog.Log = "";
eLog.Source = "XXX";
if (bLäuft == true) eLog.WriteEntry("läuft",EventLogEntryType.Information,1);
eLog.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}