Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetUserNAme
Message
De
18/02/1999 23:58:52
 
 
À
18/02/1999 16:05:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00188863
Message ID:
00189151
Vues:
9
>>>Does anyone have a routine to get the windows user name through win32API?
>>>Thanks in advance
>>>
>>
>>
DECLARE INTEGER GetUserName IN Win32API ;
>>    STRING @ UserNameBuffer, ;
>>    INTEGER @ lpLength
>>
>>cName = SPACE(200)
>>nLen = 200
>>IF GetUserName(@cName, @nLen) # 0
>>   * it worked
>>   cName = LEFT(cName,nLen - 1)
>>ELSE
>>   cName = ''
>>ENDIF
>>
>That gives me the english name. Can I get tehe name you log in with?
>Is there a paper to explain win32api routines anywhere?
>

That rerieve the WIndows Login id. If you need the specific login accessing a remote device, you nee to use WNetGetUser() which can rerieve trhe id uses to login onto the remote system attachment. It's documented in the MSDN, and ther have been threads on it oiver the last few weeks.

You can also use several AUtomation objects; among the, Wscrupt,Network to retrieve user id, server names and the like,
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform