Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get the user's name from NT?
Message
De
09/05/2000 18:53:39
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00367890
Message ID:
00367897
Vues:
14
>This isn't coming from an ActiveX control but this works under VFP 6.0.
>
>m.cUser = substr(sys(0),at("#",sys(0)) + 2)

This will blow up if the user bypasses the Windows login with the error 'Cannot access characters beyond string' - it's best to ALLTRIM like:

m.cUser = ALLTRIM(substr(sys(0),at("#",sys(0) + space(2)) + 2))

to avoid possible errors like this.
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