Board index » delphi » IP address with TP 7?

IP address with TP 7?

Is there any way to obtain the computer's IP address in turbo pascal 7?
Any help on the matter would be appreciated.

Preferably, the output would be a string.

Thanks,
Haran
mrgr...@geocities.com

PS- If possible, please reply to the email address. Thanks

 

Re:IP address with TP 7?


Quote
On Sat, 11 Oct 1997, Haran wrote:
> Is there any way to obtain the computer's IP address in turbo pascal 7?
> Any help on the matter would be appreciated.

> Preferably, the output would be a string.

It depends on the software you are using.  Hardware is not configured
with an IP address only the software.   So it depends what program you
are trying to use and its TCP/IP stack.  If you are not using Windows at
all then you have to take note of what software is actually being used.  

Most WATTCP implementations have a config file called WATTCP.CFG which is
usually pointed to by the environment variable "WATTCP.CFG"  e.g.
(WATTCP.CFG=D:\BIN  would point to D:\BIN\WATTCP.CFG).
in the file the line "my_ip" is used.

If it isn't wattcp being used and it still is a DOS program, then some of
the other common TCP/IP stacks used are FTP Softwares PC/TCP,  Trumpet's
TCPDRV, NCSA Telnet, and there is also KA9Q NOS.

FTP Software's PC/TCP as well as Trumpet's TCPDRV are both TSR's and the
IP address could probably be obtained using Interrupts (I don't know how
well you know Turbo Pascal, but I use Trumpet's TCPDRV in a few programs
on my homepage).

NCSA Telnet "usually" (not always) uses a configuration file.  It is
usually called CONFIG.TEL which contains a line called "myip=" and after
it is the IP address.

DOS PPPD PPP packet driver uses a dos environment variable called "MYIP"
which contains the IP Address.  Although I never seen any programs use
that environment variable.  Instead alls I seen is ones that use "IP".

Now, if it is Windows 3.1x then you again have to know what type of
connection is being used.  Often you can never really find out the IP
address from DOS as I don't think its obtainable from DOS.  If it is a
Static IP (non-changing) there *may* be a chance that the IP address is
saved in some .INI file somewheres, but don't count on it.

As for Windows 95 probably the same thing.  If its not a Static IP you
are not likely going to find out the IP address.

Quote
> mrgr...@geocities.com

> PS- If possible, please reply to the email address. Thanks

You won't be able to reply to this email with email itself as my email
providor blocks all email from *.geocities.com.   However if you check my
homepage you should be able to find my other email address.

--
 Jeff Patterson                       Internet: aa...@fan.nb.ca
  Author of jpIRC DOS IRC Client        PGPKey: pgp-public-k...@keys.pgp.net
| HomePage: http://www.geocities.com/SiliconValley/Vista/7104/               |
| PGP Info: 2048/A8A1DCD5 : E0 9E 9B EF C8 E4 68 3D  B5 9C 72 4C EC 61 DD 7A |

Other Threads