PLEASE, HELP ME!!!
How can I get the name of PC.?
Exits any Api?
Thanks
:eek:
Printable View
PLEASE, HELP ME!!!
How can I get the name of PC.?
Exits any Api?
Thanks
:eek:
See my post of March 13 - both methods work fine.
try this (it must go in a module)
how's that? :)Code:Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetCompName() As String
Dim compname As String, retval As Long ' string to use as buffer & return value
compname = Space(255) ' set a large enough buffer for the computer name
retval = GetComputerName(compname, 255) ' get the computer's name
' Remove the trailing null character from the strong
compname = Left(compname, InStr(compname, vbNullChar) - 1)
GetCompName = compname
End Function