Last active
November 15, 2019 14:25
-
-
Save 0o001/78d0779755df99d50abf2f66dfca10e6 to your computer and use it in GitHub Desktop.
how to check IsAdministrator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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