private static bool FileExists(string url)
{
bool b = true;
try
{
WebClient wc = new WebClient();
wc.OpenRead(url);
}
catch (WebException ex)
{
b = false;
}
return b;
}
Note that this will work but there might be several reasons (server down, access denied) why a connection may fail.