|
-
May 25th, 2006, 08:29 AM
#1
Thread Starter
Addicted Member
-
May 25th, 2006, 08:30 AM
#2
Re: Get computer name
VB Code:
Private Declare Function GetComputerName Lib "kernel32" _
Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private strMachineName As String
Private Sub GetMachineName()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetComputerName(sBuffer, lSize)
If lSize > 0 Then
strMachineName = Left$(sBuffer, lSize)
Else
strMachineName = vbNullString
End If
End Sub
-
May 25th, 2006, 08:31 AM
#3
-
May 25th, 2006, 08:52 AM
#4
Thread Starter
Addicted Member
-
May 25th, 2006, 09:20 AM
#5
Re: [RESOLVED] Get computer name
you can use a winsock control in your program.Place the winsock control in the form . By that u can get the computer name as winsock1.hostname
-
May 25th, 2006, 09:25 AM
#6
Re: [RESOLVED] Get computer name
 Originally Posted by danasegarane
you can use a winsock control in your program.Place the winsock control in the form . By that u can get the computer name as winsock1.hostname
That is true, but that would also mean rolling out and installing an OCX that might not be needed for anything else.
If Winsock were used in other parts of the program, then this is definately the way I would go as the API would no longer be needed.
-
May 25th, 2006, 09:29 AM
#7
Thread Starter
Addicted Member
Re: [RESOLVED] Get computer name
mm, I think I'll go on the first example
-
May 25th, 2006, 09:30 AM
#8
Re: [RESOLVED] Get computer name
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
|