Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

I can't get mobile IP address by my code, Help me please

$
0
0

This my code for get ip address from mobile phone

public TextView text;
text = FindViewById<TextView>(Resource.Id.viewIP);
foreach (IPAddress adress in Dns.GetHostAddresses(Dns.GetHostName()))
{
    text.Text = "IP Adress: " + adress;
}

This code don't have some error but after I ran this code my application it always close. After that I can't open application on my phone.

If somebody can suggest me for change please tell me. Thank for read it.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>