How to get the computer name

zhaozj2021-02-16  53

Program description:

This program is relatively simple, everyone will look at yourself.

The computer name is your open control panel - system - network logo - complete computer name

code:

Form1

Private Declare Function GetComputername Lib "Kernel32" Alias ​​"getcompuffernamea" (Byval Lpbuffer AS String, NSIZE AS Long) AS Long

Private submmand1_click ()

Dim Name As String, Length As Long

LENGTH = 225

Name = string (length, chr (0))

Getcomputername Name, Length

Name = Left (name, length)

Label1.caption = Name

End Sub

转载请注明原文地址:https://www.9cbs.com/read-22109.html

New Post(0)