Hello
Does anyone know how to get a new IP from the ISP (source code)?
I have a dynamic IP and right now there is some problems and the IP expires after 1 hour.
I don?t want to use winipcfg.exe!
Posted on 2002-02-13 12:55:22 by NoException
I think somone has posted code to do this somewhere on this bored. I think you use GetHostByName wich returns a structure wich contrains the IP.
Posted on 2002-02-13 22:06:36 by Quantum
--------
Does anyone know how to get a new IP from the ISP (source code)?
--------

WHAT ???
i hope i understand u right !

if yes ,you like to get a new IP from your isp ?
simply disconnect and reconnect again.

---------------
I have a dynamic IP and right now there is some problems and the IP expires after 1 hour.
--------------

you want to tell us that you connect to internet and after 1 hour you have another ip then the one you start with ?

tell me your isp !

-------------------
I don?t want to use winipcfg.exe!
-------------------

hm...last i think you mean how you can set a IP with this tool.

im shure i missunderstand your question...
Posted on 2002-02-14 02:39:04 by Max
The problem is that I DON?T have an address after 1 hour.

I have a 10 Mbit/s connection and the ISP provides dynamic addresses, that means that everytime I turn on the computer I get a new address.
Normally that address is legal until I turn off the computer or I diconnect the network card.
But now there is some problem with a server that handles the addresses I think, so after 1 hour I get disconnected.

With the program winipcfg.exe (Win98), there is some information about the network, like address and more.
There you can press Update (or Renew, I have other language than English), then a new address is recieved.
Maybe that depends on the ISP and connection type, I haven?t tested with a modem.

Instead of manually disconnect or use winipcfg.exe I wan?t to write a program that handles that for me (I am tired of beeing interupted when I?m surfing).
Posted on 2002-02-14 07:11:43 by NoException
try ipconfig /?
you could write an app that executes ipconfig /renew or ipconfig /release or whatever after an hour or when it detects no internet connection or something like that.

be creative ;)
Posted on 2002-02-14 08:07:16 by savage
Thanks

Great, problem solved.
Both ipconfig.exe and winipcfg.exe handles /renew_all so calling them is super.
But super super would be to know exactly how they do it.
Posted on 2002-02-14 08:22:48 by NoException
take a look at the ip helper api's, Thomas posted some docs and info about it some time ago in this thread:
http://www.asmcommunity.net/board/index.php?topic=2246

The function IpRenewAddress sounds just like what you are looking for ;)
Posted on 2002-02-14 09:01:33 by savage
Study the DHCP protocol man! ;)

Latigo
Posted on 2002-02-15 08:15:11 by latigo