RPS.Screensaver.IsRunAsAdmin C# (CSharp) Метод

IsRunAsAdmin() статический приватный Метод

The function checks whether the current process is run as administrator. In other words, it dictates whether the primary access token of the process belongs to user account that is a member of the local Administrators group and it is elevated.
static private IsRunAsAdmin ( ) : bool
Результат bool
        static bool IsRunAsAdmin() {
            WindowsIdentity id = WindowsIdentity.GetCurrent();
            WindowsPrincipal principal = new WindowsPrincipal(id);
            return principal.IsInRole(WindowsBuiltInRole.Administrator);
        }