Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving Windows Group Membership
Message
De
05/04/2007 06:50:28
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2003 Server
Divers
Thread ID:
01212365
Message ID:
01212368
Vues:
15
Hello,

there are at least 3 ways i've found to query if the user has administrative rights.

1. NetUserGetInfo function - query for information level 1 and check
the "usri1_priv" field
http://msdn2.microsoft.com/en-us/library/aa370654.aspx
example in C
http://groups.google.de/group/borland.public.cppbuilder.winapi/browse_thread/thread/c3cf04a2b1ba722c/b4f8f6f7006873df?lnk=st&q=NetUserGetInfo+administrator&rnum=4&hl=de#b4f8f6f7006873df

2.IsUserAnAdmin function - very easy to use but might be unsupported in future OS Versions (and not available depending on service pack level/ shell32.dll version)
see notes @
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/isuseranadmin.asp?frame=true

3. The hardcore API way, should be easily convertable into an FLL function, but I wouldn't do it in pure FoxPro code

http://support.microsoft.com/?scid=kb%3Ben-us%3B118626&x=16&y=17


Regards
Christian
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform