|
-
Feb 10th, 2003, 03:05 PM
#1
Thread Starter
Member
Computer Name
Does anyone know how to get the computer name from a windows box using Vb?
Thanks for the help in advance.
-Jason
-
Feb 10th, 2003, 03:07 PM
#2
Fanatic Member
You can use the Winsock. RemoteHost I think
-
Feb 10th, 2003, 03:08 PM
#3
PowerPoster
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
-
Feb 10th, 2003, 03:16 PM
#4
Thread Starter
Member
Thanks!!
The Winsock Worked LocalHostName not remote host. Thanks alot.
-Jason
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|