GetUserID



'Inserire la seguente dichiarazione in un modulo Bas

Public Declare Function WNetGetUserA Lib "mpr" (ByVal lpName As String _
ByVal lpUserName As String, lpnLenght As Long) As Long

'Creare una funzione pubblica da richiamare cosi':


MiaStringa = NomeUtente

Function NomeUtente() As String
Dim sUserNameBuff as String * 255
sUserNameBuff = Space(255)
Call WNetGetUserA( vbNullString , sUserNameBuff , 255&)
NomeUtente = Left$( sUserNameBuff , InStr( sUserNameBuff , vbNullChar ) - 1)
End Function


(getuserid.html)- by Paolo Puglisi - Modifica del 25/3/2019