You can enter: "My IP Address" in Bing find, and then confirm that you can see your own IP.
If you need code programming to get a native IP, you can use the following code:
Note: This code cannot be compiled on WP7.1, NetworkInformation is undefined.
1 Public classgethostipaddress2 { 3 Public stringgetipaddress ()4 { 5 stringstrIPAddress =NULL; 6list<string> arrayipaddress =Newlist<string>(); 7 //Windows.Networking.Connectivity.8 varHostnames =Windows.Networking.Connectivity.NetworkInformation.GetHostNames (); 9 foreach(varHninchhostnames)Ten { One if(HN. Ipinformation! =NULL) A { - stringIpAddress =HN. DisplayName; - Arrayipaddress.add (ipAddress); the } - } - if(Arrayipaddress.count <1) - { + return NULL; - } + if(Arrayipaddress.count = =1) A { atstrIPAddress = arrayipaddress[0]; - } - if(Arrayipaddress.count >1) - { -strIPAddress = Arrayipaddress[arrayipaddress.count-1]; - } in //System.Console.WriteLine (); - for(inti =0; I < arrayipaddress.count;i++ ) to { +System.Diagnostics.Debug.WriteLine ("no.{0} host IP is: {1}", i +1, Arrayipaddress[i]); - } the returnstripaddress; * } $}
Invocation Example:
1 { 2 new gethostipaddress (); 3 hostip.getipaddress (); 4 }
The run input is as follows:
Host IP is:169.254.135.85no.2 host IP is:169.254.162.98no.3 host IP is:192.168.0.101
Windows Phone8 get the native IP address