English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to find ip address of computer through FOXPRO for DOS so as to authorize only those computers whose ip address is mentioned in the database of FOXPRO to run the DOS based programs. For this I need to find the IP address of the computer whenever the FOXPRO based program is RUN. If the IP address found matches with that mentioned in the DATABASE of foxpro the program should RUN otherwise NOT.

Can any one let me know how to do it in FOXPRO for DOS
OR if someone can tell me any DOS utility through which i can capture the ipaddress of the machine.

Thanks

2006-07-27 02:51:25 · 7 answers · asked by sunil 2 in Computers & Internet Programming & Design

7 answers

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

fedest.com, questions and answers