*Experts* Merrion Posted April 7, 2003 *Experts* Posted April 7, 2003 How would I find out if the logged in user is an administrator? I'd arther not throw an error (as per the System.Codepermissions derived classes) but just not do the operation that requires Admin. access. Or is this the wrong way to go about this these days? Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Leaders quwiltw Posted April 7, 2003 Leaders Posted April 7, 2003 The WindowsPrinciple class has an IsInRole method that takes a WindowsBuiltInRole enum type (one of which is Administrator). That should get you what you need. This article takes you through the first part but doesn't include a call to IsInRole which should be self-explanatory. http://samples.gotdotnet.com/quickstart/howto/doc/security/WindowsIdentityCheck.aspx Quote --tim
*Experts* Merrion Posted April 7, 2003 Author *Experts* Posted April 7, 2003 Looks good - thanks. Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Recommended Posts