PDA

Click to See Complete Forum and Search --> : GetComputerName


iataman
Jun 27th, 2000, 06:17 AM
how does GetComputerName works??

its GetComputerName(Buffer, Length) as long
i've tried everything (nearly everything)
but i can't get the x@!x'x name!

Jun 27th, 2000, 06:21 AM
See if this is any help
http://www.vbapi.com/ref/g/getcomputername.html

Supera
Jun 29th, 2000, 12:21 AM
This is an example :
in the module,declare the function like this:
Public Declare Function GetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long.

form_load()
dim retval as long,PCname as string
PCName = space(255)
retval=GetComputerName(PCName,255)
PCName=Left(PCName, InStr(PCName, vbNullChar) - 1)
msgbox PCName
end sub
'Excuse me but there is no comment.
I think I have help you
Regards,
Supera.

prye
Jul 6th, 2000, 05:18 PM
enviorn$("COMPUTERNAME") thats easier ;]