I need to get the ipv4 address of the device without accessing external sites.
IPAddress[] LocalIp = Dns.GetHostAddresses(Dns.GetHostName());
foreach (IPAddress iP in LocalIp)
{
if (iP.AddressFamily == AddressFamily.InterNetwork)
{
MachineIP = iP;
}
}
returns local IP but I need to know the public IP of the device on the 3G network and when connecting to wi-fi that of wi-fi. does anyone have any suggestions?