コード例 #1
0
 private static bool CanAccess(string scheme, IPEndPoint addr)
 {
     if (addr == null)
     {
         return(false);
     }
     try
     {
         Uri           url  = new Uri(scheme + "://" + NetUtils.GetHostPortString(addr));
         URLConnection conn = connectionFactory.OpenConnection(url);
         conn.Connect();
         conn.GetContent();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }