void FindLocalIP_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
var result = e.Result;
if (result == null)
return;
int first = result.IndexOf("Address: ") + 9;
int last = result.LastIndexOf("</body>");
string ip = null;
if (first != -1 && last != -1 && first < last)
ip = result.Substring(first, last - first);
SetLocalIP(IPAddress.Parse(ip));
}
catch { }
}