Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the user name?
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00141215
Message ID:
00141338
Vues:
25
Yes ther's one. Try :

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" ( _
ByVal lpBuffer As String, _
nSize As Long) _
As Long
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (_
ByVal lpBuffer As String, _
nSize As Long) _
as long

Dim sTmp As String
Dim R As Long
Dim sUserName As String
Dim sComputerName As String

sTmp = String(100, Chr$(0))
R = GetUserName(sTmp, 100)
sUserName = Left(sTmp, InStr(sTmp, Chr$(0)) - 1)
R = GetComputerName(sTmp, 100)
sComputerName = Left(sTmp, InStr(sTmp, Chr$(0)) - 1)
VB Developer
Servilog Concept
jmb@octalfrance.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform