c# Programming Glossary: isadmin
In .NET/C# test if user is an administrative user http://stackoverflow.com/questions/1089046/in-net-c-test-if-user-is-an-administrative-user bool value to hold our return value bool isAdmin try get the currently logged in user WindowsIdentity user WindowsIdentity.GetCurrent.. WindowsPrincipal principal new WindowsPrincipal user isAdmin principal.IsInRole WindowsBuiltInRole.Administrator catch UnauthorizedAccessException.. catch UnauthorizedAccessException ex isAdmin false catch Exception ex isAdmin false return isAdmin share..
Process.Start with different credentials with UAC on http://stackoverflow.com/questions/2313553/process-start-with-different-credentials-with-uac-on new WindowsPrincipal WindowsIdentity.GetCurrent bool isAdmin principal.IsInRole WindowsBuiltInRole.Administrator if isAdmin.. principal.IsInRole WindowsBuiltInRole.Administrator if isAdmin ProcessStartInfo processInfo new ProcessStartInfo processInfo.Verb.. Process.Start processInfo return isAdmin EDIT Tried CreateProcessWithLogonW ... Had same problem. After..
|