Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get the user name that use the Application.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00562902
Message ID:
00562923
Vues:
32
>hi,
>
>My application(Exe+Database) is On the Network.
>it is posible that i get all the users name or their computer names those who using my appliction on the network.
>
>regards,
>Mobeen.

There are a couple of ways. Easiest would be to use the WScript.Network object of the Windows Script Host.
oNet = CREATEOBJECT("WScript.Network")
? oNet.UserName
Now if the WSH isn't available...
DECLARE INTEGER WNetGetUser IN Win32API;
  STRING @lpszLocalName, STRING @lpszUserName,; 
  INTEGER @lpcchBuffer
LOCAL lcresult, lnpt, lnargs
* Call to the API
lcresult = SPACE(200)
= WNetGetUser(0, @lcresult, LEN(lcresult)) 
lnpt = AT(CHR(0), lcresult)
IF lnpt > 1
  lcresult = LEFT(lcresult, lnpt - 1)
ELSE
  lcresult = ""
ENDIF
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform