Do you mean the address of the router, i.e. the gateway?

If so, look at EnumIPInfo() for one method - you will want to retrieve type "3".

For example:
Code:
"Default gateway: "+EnupIPInfo(0,3)+@CRLF



If you want to know the routers WAN ip address, you will need to resort to SNMP or scripted login to the router.

Tracert may also give you the information you require, for example:
Code:
c:\> tracert www.microsoft.com



Explain a little bit more about what you are looking for, and why.