Does anyone know how to get the computer name from a windows box using Vb?
Thanks for the help in advance.
-Jason
Printable View
Does anyone know how to get the computer name from a windows box using Vb?
Thanks for the help in advance.
-Jason
You can use the Winsock. RemoteHost I think
Public Function GetMachineName() As String
Dim sBuffer As String * 255
If GetComputerNameA(sBuffer, 255&) <> 0 Then
GetMachineName = Left$(sBuffer, InStr(sBuffer, vbNullChar) - 1)
Else
GetMachineName = "(Not Known)"
End If
End Function
in your code:
dim glbmachine as string
glbMachineName = GetMachineName
If glbMachineName = blah, blah, blah
The Winsock Worked LocalHostName not remote host. Thanks alot.
-Jason