当前位置:编程学习 > VB >>

显示计算机的名称

 

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

 

补充:软件开发 , Vb ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,