VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 如何取得计算机名
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:14452, 日期:2004-01-31
 
  程序说明:

  这个程序比较简单,大家自己看吧

  计算机名就是你打开 控制面板-系统-网络标识-完整的计算机名称

  程序代码:



Form1

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

Private Sub Command1_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

Private Sub Form_Load()

End Sub