If current user ID log into the network, I want to have the capability of putting that ID into my current user txt box.
Is there a way to do that. I know in DOS, you grab that by
using %username%
Thank you,
-D1004
Some years back I found this and kept it for later use, leter has not come yet , so I have not tryed it but here it is:
Private Declare Function getusername Lib "advapi32" Alias "GetUserNameA"
(ByVal buffer As String, buffersize As Long) As Long
------------------------------------------------------------------------
Function getuser() As String
Dim username As String * 255
Dim namesize As Long
Dim errno As Long
namesize = Len(username)
errno = getusername(username, namesize)
getuser = Left(username, namesize - 1)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.