VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 获得用户网络登录名
发表评论(0)作者:, 平台:, 阅读:12347, 日期:2000-03-12
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Public Function NTDomainUserName() As String

Dim strBuffer As String * 255

Dim lngBufferLength As Long

Dim lngRet As Long

Dim strTemp As String


lngBufferLength = 255

lngRet = GetUserName(strBuffer, lngBufferLength)

strTemp = UCase(Trim$(strBuffer))

NTDomainUserName = Left$(strTemp, Len(strTemp) - 1)


End Function