VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Retrieves Computer Name/ID You Will Need 1 Command Button

by Tom Putland (3 Submissions)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Sat 11th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Retrieves Computer Name/ID You Will Need 1 Command Button

API Declarations



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


Rate Retrieves Computer Name/ID You Will Need 1 Command Button



Dim strBuffer As String
  Dim lngBufSize As Long
  Dim lngStatus As Long
  
  lngBufSize = 255
  strBuffer = String$(lngBufSize, " ")
  lngStatus = GetComputerName(strBuffer, lngBufSize)
  If lngStatus <> 0 Then
     MsgBox ("Computer name is: " & Left(strBuffer, lngBufSize))
  End If
End Sub

Download this snippet    Add to My Saved Code

Retrieves Computer Name/ID You Will Need 1 Command Button Comments

No comments have been posted about Retrieves Computer Name/ID You Will Need 1 Command Button. Why not be the first to post a comment about Retrieves Computer Name/ID You Will Need 1 Command Button.

Post your comment

Subject:
Message:
0/1000 characters