Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting computer name
Message
 
To
28/03/2007 14:13:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01209339
Message ID:
01209354
Views:
29
This message has been marked as the solution to the initial question of the thread.
Hello I use these routines
function Computer_Name
	local lcComputer, lnSize
	lcComputer = space(80)
	lnSize = 80
	declare integer GetComputerName in WIN32API string @cComputerName, integer @nSize
	= GetComputerName(@lcComputer, @lnSize)
	if lnSize < 2
		lcComputer = ""
	else
		lcComputer = substr(lcComputer, 1, lnSize)
	endif
	return lcComputer
endfunc

function Direccion_IP
	IPSocket = createobject("MSWinsock.Winsock")
	if type('IPSocket') = 'O'
		return IPSocket.LocalIP
	else
		* messagebox("Winsock no está instalado!")
		return ""
	endif
endfunc
c.x.

>Hi
>I want to get the full computer name of the current computer (desktop\my computer\properties\computer name) and/or the current internal ip address.
>Help please
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform