Пример #1
0
 public static IPAddress GetMyCurrentIPAddress()
 {
     try
     {
         var req = new HTTPGet();
         req.Request("http://checkip.dyndns.org");
         string[] a  = req.ResponseBody.Split(':');
         string   a2 = a[1].Substring(1);
         string[] a3 = a2.Split('<');
         string   a4 = a3[0];
         return(IPAddress.Parse(a4));
     }
     catch
     {
         return(new IPAddress(new byte[] { 255, 255, 255, 255 }));
     }
 }
Пример #2
0
 public static IPAddress GetMyCurrentIPAddress()
 {
     try
     {
         var req = new HTTPGet();
         req.Request("http://checkip.dyndns.org");
         string[] a = req.ResponseBody.Split(':');
         string a2 = a[1].Substring(1);
         string[] a3 = a2.Split('<');
         string a4 = a3[0];
         return IPAddress.Parse(a4);
     }
     catch
     {
         return new IPAddress(new byte[] {255, 255, 255, 255});
     }
 }