I would like to know how to check if the file exists before downloading.
Current code:
string url = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/text.txt";
string path = "asdf.wix.com/text.txt";
using (var client = new WebClient())
{
client.DownloadFile(url, path);
}
The code works but if the file is missing on the site it creates a empty text.txt that causes issues.
Any ideas? Thank you!