Код: Выделить всё
static bool IsAdministrator()
{
WindowsIdentity identity = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(identity);
return principal.IsInRole (WindowsBuiltInRole.Administrator);
}
Как определить, повышение прав [уже вступило в силу или] возможно?
Подробнее здесь: https://stackoverflow.com/questions/122 ... privileges