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); }
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; }