Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Workstation's IP Address
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00526200
Message ID:
00526831
Views:
15
You'll find licensing errors with the mswinsock OCX if you try to use it on a machine without development tools installed.

The best solution I've found is to run IPCONFIG (as mentioned earlier in this thread). You can avoid the DOS window this way:

loWSH=CreateObject("Wscript.Shell")
if vartype(loWSH)='O'
loWSH.run("command /c ipconfig > "+lcTempfile,0,1)
if file(lcTempFile) &&read the file and parse it
lcRetVal=upper(filetostr(lcTempFile))
lcRetVal=substr(lcRetVal, at('IP ADDRESS',lcRetVal))
lcRetVal=substr(lcRetVal, at(':',lcRetVal)+2)
lcRetVal=substr(lcRetVal, 1, at(chr(13),lcRetVal)-1)
endif
else
lcRetVal='Can not create windows scripting host object - is WSHOM.OCX installed?'
endif

It requires that Windows Scripting Host be installed however.

Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform