来个高手帮我解决下VB的问题,谢谢了!
Private Sub Form_Load()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtUserName.Text = Left$(sBuffer, lSize)
Else
txtUserName.Text = vbNullString
End If
End Sub
麻烦能给我解释下这是什么意思吗?
我在调试的时候总是在这里出问题!Thank you!
[解决办法]
Public Declare Function GetUserName Lib "advapi32.dll " Alias "GetUserNameA " (ByVal lpBuffer As String, nSize As Long) As Long
[解决办法]
你需在窗体添加1文本框,名称改为txtUserName。此外下列API声明应放标准模块:
Public Declare Function GetUserName Lib "advapi32.dll " Alias "GetUserNameA " (ByVal lpBuffer As String, nSize As Long) As Long
[解决办法]
都==,让俺来解决