It depends on which address you want:
If you want the address of the modem on your network, so you can talk to it:
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'");
ManagementObjectCollection moc = mos.Get();
foreach (ManagementObject mo in moc)
{
string[] gateways = (string[])mo["DefaultIPGateway"];
foreach (string gateway in gateways)
{
Console.WriteLine("Gateway: {0}", gateway);
}
}
You will need to add a reference to the System.Management namespace
If you want to get the IP address that the modem uses to talk to the Internet (i.e. the IP address that you get called when you are visiting a site) then you have to talk to the internet and get a response - there are quite a few sites which will send you back that information - google will find one you like.