VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 得到登入windows 的人的id
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:12164, 日期:2001-09-17
得到登入windows 的人的id


 

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

Private Sub Form_Load()
Dim aa As Long
Dim len5 As Long
Dim usern As String
len5 = 256
usern = String(255, 0)
aa = GetUserName(usern, len5)
usern = Left(usern, InStr(1, usern, Chr(0)) - 1)
Debug.Print usern
End Sub