Detect Gateway IP address in windows

MisterX b.xavier at internet.lu
Sat Oct 9 01:36:47 EDT 2004


Mark

Although correct this assumes you only have one network card (NIC),
which I've seen becoming rare lately... ;)

I have 4 of which 2 are virtual for vmwares and 1 is my wifi 
intra-home-net, and the remaining internet dsl...

Here's a slightly modified function with an xos twist 
(IOW, generalise any function for reuse on any occasion).

...
put getW32IpInfos("gateway")
...

function getW32IpInfos what
   local ipStuff

   put shell("ipconfig /all") into ipStuff
   filter ipStuff with "*" & what & "*"
   set the itemdelimiter to ":"
   repeat with x = 1 to the number of lines in ipstuff
     put last item of line x of ipstuff into line x of ipstuff
   end repeat
   return ipStuff
end getW32IpInfos

But I think it would be nicer to have an array with each NIC's
properties. This is a planned function for the xos network 
manager.

But as someone said, it's rather useless unless you're solving
net problems...

cheers
Xavier

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Mark Wieder
> Sent: Friday, October 08, 2004 6:27 PM
> To: How to use Revolution
> Subject: Re: Detect Gateway IP address in windows
> 
> RGould8-
> 
> Friday, October 8, 2004, 7:36:27 AM, you wrote:
> 
> Rac> I've seen techniques for retrieving the user's local IP 
> address in 
> Rac> Windows into a Revolution variable, but I haven't yet 
> seen an example of how one goes
> Rac> about retrieving the "gateway ip address".   (For 
> example, the IP address of a
> Rac> DSL router connected to the PC.)   Can anyone tell me 
> how one could retrieve
> Rac> this info in Windows?
> 
> Depends. On Win2k and XP with one connection,
> 
> on mouseUp
>   local ipStuff, pos
>   
>   put shell("ipconfig") into ipStuff
>   put the last word of ipStuff
> end mouseUp
> 
> I think it's "winipconfig" under Win95. Also, if you have 
> multiple connections (DSL, modem) you will find both of those 
> listed in ipStuff and you'll have to parse through to find 
> the one you're interested in.
> 
> --
> -Mark Wieder
>  mwieder at ahsoftware.net
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list