|声明模块:
Option Explicit Declare Function GetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, _ nSize As Long) As Long Private Declare Function WNetVerifyPassword Lib "mpr.dll" Alias _ "WNetVerifyPasswordA" (ByVal lpszPassword As String, _ ByRef pfMatch As Long) As Long Public Function GetWindowsLoginUserID() As String Dim rtn As Long Dim sBuffer As String Dim lSize As Long sBuffer = String$(260, Chr$(0)) lSize = Len(sBuffer) rtn = GetUserName(sBuffer, lSize) If rtn Then sBuffer = l...[ 查看全文 ]