Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get a Registry Key Value?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
How do I get a Registry Key Value?
Divers
Thread ID:
00529701
Message ID:
00529701
Vues:
40
My goal is to get a string telling me who is currently logged on to WindowsNT. I have found a Registry Key (HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Winlogon/DefaultUserName) that I believe holds this information.

There might be an easier way but what I have done so far is add the Registry.vcx to my project and copied a registry object to my form. I am attemping to figure out how to use it but there isn't much help available that I've found. It seems I should be using the GetKeyValue method or the GetRegKey method.

I have tried this code:
pUser=thisform.registry1.getkeyvalue('HKEY_LOCAL_MACHINE/ ... /DefaultUserName')

pUser is set to equal -105 so I'm obviously doing something wrong. Could someone please tell me how to set up the registry object to return the UserID or give me an easier way of getting it?

Thanks in advance,
Justin
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform