Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows NT 4.0 UserName into a VFP 6.0 application?
Message
De
30/12/1999 05:13:38
 
 
À
29/12/1999 14:14:50
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00310006
Message ID:
00310276
Vues:
19
>How can I get the UserName used to log on to a NT 4.0 Windows Workstation, into a VFP 6.0 application?
>
>Thanks in advance!

Hi John,

here comes my solution: (two related functions)

FUNCTION cGetUserName
LOCAL lcUserName, lnNameLength
DECLARE INTEGER GetUserName IN WIN32API STRING @lcUserName, INTEGER @lnNameLength
lcUserName=space(256)
lnNameLength=255
GetUserName(@lcUserName, lnNameLength)
IF at(chr(0),lcUserName,1)>0
lcUserNAme=left(lcUserName,at(chr(0),lcUserName,1)-1)
ENDIF
RETURN lcUserName


FUNCTION cGetComputerName
DECLARE INTEGER GetComputerName IN WIN32API STRING @lcComputerName, INTEGER @lnNameLength
LOCAL lcComputerName, lnNameLength
lcComputerName=space(256)
lnNameLength=255
GetComputerName(@lcComputerName, lnNameLength)
IF at(chr(0),lcComputerName,1)>0
lcComputerName=left(lcComputerName,at(chr(0),lcComputerName,1)-1)
ENDIF
RETURN lcComputerName



I hope this helps you.

bb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform