关于 用户名 提取
一般的软件在帮助中有一项是关于.... 里面一般有使用权归属的问题,不知道那个系统登录用户名是怎么提取出来的?
使用API:
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim str As String * 80
GetComputerName str, Len(str)
Text1.Text = str
GetUserName str, Len(str)
Text2.Text = str
End Sub