显示计算机的名称

页面导航:首页 > 软件编程 > vb.net > 显示计算机的名称

显示计算机的名称

来源: 作者: 时间:2016-02-05 12:32 【

Declare Function GetComputerName Lib "Kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As LongSub GetComputerName_test()Dim Name As String, Len

 

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

 

Tags:

相关文章

    文章评论

    最 近 更 新
    热 点 排 行
    Js与CSS工具
    代码转换工具
    
    <