Réponse acceptée !
Salut,
Api...à déclarer soit dans ta form, soit un module dans ce cas Private >> Public :
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer AsString, nSize AsInteger ) AsInteger
Private Function UserId() AsString
'**************************************************************************/
' Fonction qui donne l'user de la machine
'**************************************************************************/
' Retourne le nom d'utilisateur enregistrer sur sa machine
Dim ValParm AsString
Dim ret AsInteger
Dim Lng AsInteger
ValParm = String$(20, " ")
Lng = Len(ValParm)
ret = GetUserName(ValParm, Lng)
UserId = Left$(ValParm, Lng - 1)
End Function
Utilisation dans ton form_load :
TonLabel = UserId
A+
Exploreur
Linux a un noyau, Windows un pépin 