Can FoxPro do API calls? In MS Access you can call an API which will return the machine's name. There are also API's that can return the IP. (Duh, I just realized, FoxPro for DOS came out BEFORE windows, hence it wouldn't directly support API calls, but there *may* be some DOS calls that support the TCP/IP stack, if you can do DOS calls from FoxPro or if you can find a way to call the Windows API from a DOS program)
I'm assuming you're running FoxPro for DOS on Windows machines? If so . . .
You *COULD* create a batch file that runs IPCONFIG and pipes the output into a text file, (IPCONFIG > MYFILE.TXT). run the batch file from foxpro (MS Access uses the 'Shell' command: Shell ("batchfile.bat") ). Then parse the text file for the IP. (This will not work on Win98 though, it does not have IPCONFIG. NT, W2K and XP do, and I'm not sure about WinME)
Of course for this to work, you need to install the batch file on any machine that may run your database. No problem though, just open a text file from within Foxpro, name it "FindIP.bat" and write the line: IPCONFIG > c:\IPDATA.TXT into it. Close it then run the shell command (or whatever it may be).
I think it is the 'Run' command, I grabbed this from another question:
"you can use either 'run' or '!' command in foxpro.
the windows path should contain the location for command.com or it will throw an error. "
So I guess the command to run the batch file would be:
Run "c:\batchfile.bat"
not sure though
I also found this:
"For all your foxpro related problems it will be my pleasure to help you or any one else. M C Bothra mcbothra99@yahoo.co.in "
You can search the web for:
FoxPro DOS Calls finding IP
Running batch files from foxpro
DOS command pipes
Reading text file from foxpro
BTW: If the computer(s) are running just DOS and do not have Windows installed, then you do not have IPCONFIG. You would need to use another command line net status program, one that perhaps came with your TCP/IP installation.
2006-07-27 03:16:59
·
answer #1
·
answered by ExcelerNot 2
·
0⤊
0⤋
Go to C:\ and then type ipconfig, press Enter, you will get the IP address!
2006-07-27 02:56:28
·
answer #2
·
answered by nice_libra_guy 6
·
0⤊
0⤋
Windows Vista
2016-03-27 01:13:55
·
answer #3
·
answered by Anonymous
·
0⤊
0⤋
DOS utility:
ipconfig
gives you net infos like ip address, subnet mask and default gateway, if you can parse it, you will be able to filter the ip address.
2006-07-27 02:55:14
·
answer #4
·
answered by d_creeper18 1
·
0⤊
0⤋
Ipconfig is correct. Give that guy 10 points!
2006-07-27 02:56:12
·
answer #5
·
answered by Special Ed 5
·
0⤊
0⤋
according to me ip address is not required to connect the network or server. through novell netware you can run through your Ethernet card configuration ipx,netx, and your Ethernet card execution file.
2006-07-27 03:00:54
·
answer #6
·
answered by mindreader 2
·
0⤊
0⤋
ipconfig or ipconfig /all for more detailed information.
2006-07-27 03:26:16
·
answer #7
·
answered by valsacar 4
·
0⤊
0⤋