Hi, :wave:
How do I get the computer name? There must be some kind of function for it...
Plz help! :cry:
//Alex :D
Printable View
Hi, :wave:
How do I get the computer name? There must be some kind of function for it...
Plz help! :cry:
//Alex :D
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
Look here : http://www.allapi.net/apilist/GetComputerName.shtml at the GetComputerName example :)
tnx a lot man!
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.Quote:
Originally Posted by danasegarane
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.
mm, I think I'll go on the first example
thanks