VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 取得计算机名
发表评论(0)作者:, 平台:, 阅读:12100, 日期:2000-03-12
显示计算机的名称

Declare Function GetComputerName Lib "Kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Sub GetComputerName_test()

Dim Name As String, Length As Long

Length = 255

Name = String(Length, 0)

GetComputerName Name, Length

Name = Left(Name, Length)

MsgBox "此电脑的名称:=" & Name, , "GetComputerName"

End Sub


Sub Main()

GetComputerName_test

End Sub