示例#1
0
 public bool CheckIfFileExists(string url)
 {
     // using MyClient from linked post
     using (var client = new MoG.Domain.Common.SimpleWebClient())
     {
         client.HeadOnly = true;
         // fine, no content downloaded
         try
         {
             string s1 = client.DownloadString(url);
         }
         catch (Exception)
         { // throws 404
             return(false);
         }
     }
     return(true);
 }
示例#2
0
 public bool CheckIfFileExists(string  url)
 {
     // using MyClient from linked post
     using (var client = new MoG.Domain.Common.SimpleWebClient())
     {
         client.HeadOnly = true;
         // fine, no content downloaded
         try
         {
             string s1 = client.DownloadString(url);
         }
         catch (Exception)
         { // throws 404
             return false;
         }
     }
     return true;
 }