Hi!
Use the GetAdaptersInfo Win32 API, via PInvoke, and get the Gateway IP
address. The following links should help you:
http://msdn.microsoft.com/library/en-us/iphlp/iphlp/getadaptersinfo.asp
http://support.microsoft.com/?kbid=223025
http://www.codeguru.com/network/ViewAdapterInfo.html

Signature
Regards,
Kumar Gaurav Khanna
-----------------------------------------------------------------
Microsoft MVP - C#/.NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/
Bangalore .NET Users' Group
http://groups.msn.com/bdotnet/
>
> Hello All!
[quoted text clipped - 7 lines]
> Kind regards,
> Nodir Gulyamov
Dino Chiesa [Microsoft] - 28 Jan 2004 22:51 GMT
Example:
http://www.winisp.net/cheeso/srcview.aspx?file=MyIpConfig.cs
-Dino
> Hi!
>
[quoted text clipped - 15 lines]
> > Kind regards,
> > Nodir Gulyamov
Take a look at the System.Management classes and the WMI class
Win32_NetworkAdapterConfiguration.
Here's sample to get you started.
using System;
using System.Management;
using System.Runtime.InteropServices;
using System.Threading;
public class Wmis {
public static void Main() {
//Index (here 9 as a sample) depends on the number of network adapters and
protocols bound to it.
// Use the Win32_NetworkAdapter class to get the index of the adapter for
which you need to query the configuration.
using (ManagementObject netw = new
ManagementObject("Win32_NetworkAdapterConfiguration.Index=9"))
{
foreach(string gw in netw["DefaultIpGateway"] as string[]) // property is
a string array
Console.WriteLine( "GateWay\t?{0}?", gw);
}
}
}
Willy.
> Hello All!
> I need to get default gateway address of local machine or get local
[quoted text clipped - 6 lines]
> Kind regards,
> Nodir Gulyamov