|
|
От: | senglory | |
| Дата: | 24.03.14 08:20 | ||
| Оценка: | |||
EventLog objEventLog = new EventLog();
string _sourceName = "ENT Foundation";
try
{
// поднимаем себе привилегии для записи в системный лог
System.Security.Principal.WindowsImpersonationContext wic = System.Security.Principal.WindowsIdentity.Impersonate(IntPtr.Zero);
if (!(EventLog.SourceExists(_sourceName)))The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
|
|
От: | Sinix | |
| Дата: | 24.03.14 08:43 | ||
| Оценка: | |||
(c)Calling the Impersonate(IntPtr) method with a userToken value of Zero is equivalent to calling the Win32 RevertToSelf function. If another user is currently being impersonated, control reverts to the original user.