Some snippet code for checking file exists from remote server using WebClient.
private bool RemoteFileExists(string url)
{
bool bResult = false;
using (WebClient client = new WebClient())
{
try
{
client.UseDefaultCredentials = true;
Stream stream = client.OpenRead(url);
if (stream != null)
bResult = true;
else
bResult = false;
}
catch
{
bResult = false;
}
}
return bResult;
}
Incoming search terms:
- asp net does file exist on remote server (1)
- php check email exist 2012 (1)
- how check client email exixt in php (1)
- file exists webclient (1)
- file exists on remote server (1)
- check if file exists on remote server using asp net (1)
- c# remote file exist (1)
- c# is file exist on remote server (1)
- c file exists on remote server (1)
- c check server file exists ~/ (1)