Skip to content

Instantly share code, notes, and snippets.

@0o001
Last active November 15, 2019 14:25
Show Gist options
  • Save 0o001/78d0779755df99d50abf2f66dfca10e6 to your computer and use it in GitHub Desktop.
Save 0o001/78d0779755df99d50abf2f66dfca10e6 to your computer and use it in GitHub Desktop.
how to check IsAdministrator
//Kullanıcının yönetici olup olmadığını öğrenme
public static bool IsAdministrator()
{
return (new WindowsPrincipal(WindowsIdentity.GetCurrent()))
.IsInRole(WindowsBuiltInRole.Administrator);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment