得到计算机名,………之后工作不用我教了吧??Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As LongFunction sGetComputerName() As String
Dim sBuffer As String
Dim lBufSize As Long
Dim lStatus As Long
lBufSize = 255
sBuffer = String$(lBufSize, " ")
lStatus = GetComputerName(sBuffer, lBufSize)
sGetComputerName = ""
If lStatus <> 0 Then
sGetComputerName = Left(sBuffer, lBufSize)
End If
MsgBox sGetComputerName
End FunctionPrivate Sub Command1_Click()Dim x
x = sGetComputerNameEnd Sub
Dim sBuffer As String
Dim lBufSize As Long
Dim lStatus As Long
lBufSize = 255
sBuffer = String$(lBufSize, " ")
lStatus = GetComputerName(sBuffer, lBufSize)
sGetComputerName = ""
If lStatus <> 0 Then
sGetComputerName = Left(sBuffer, lBufSize)
End If
MsgBox sGetComputerName
End FunctionPrivate Sub Command1_Click()Dim x
x = sGetComputerNameEnd Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货