获得用户网络登录名

页面导航:首页 > 软件编程 > vb.net > 获得用户网络登录名

获得用户网络登录名

来源: 作者: 时间:2016-02-05 12:32 【

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As LongPublic Function NTDomainUserName() As String

 

 

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

 

Tags:

相关文章

    文章评论

    最 近 更 新
    热 点 排 行
    Js与CSS工具
    代码转换工具
    
    <