Loading

Wednesday, April 7, 2010

How to Get Computer Name (Visual Basic 6)

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

Function Get_CompName() As String
    ' Returns the name of the local computer.
    Dim BUFFER As String * 512, length As Long
    length = Len(BUFFER)
    If GetComputerName(BUFFER, length) Then
        ' this API returns non-zero if successful,
        ' and modifies the length argument
        Get_CompName = Left(BUFFER, length)
    End If
End Function

SHARE TWEET

Thank you for reading this article How to Get Computer Name (Visual Basic 6) With URL https://x-tutorials.blogspot.com/2010/04/how-to-get-computer-name-visual-basic-6.html. Also a time to read the other articles.

0 comments:

Write your comment for this article How to Get Computer Name (Visual Basic 6) above!