title: Don't Want to Download the Specified File if Not Exist on Website
body: <p>i faced an issue with downloading file from website.</p>
  
  <p>A user can fill in the textbox (example: hello.html) and then click on a button to download the html file. Now my issue is: even the file "hello.html" is not exists, my code will tend to download it as well. There will be "index.html" file appears in folder. How do I write "if" statement so that I can tell the code not to download if the file is not exist?</p>
  
  <p>My code:</p>
  
  <pre><code>if (FILE NOT EXIST ON THE WEBSITE)
           {
                //MessageBox.Show("There is no such file on the website. Please check your spelling.");             
           }
           else
           {
                client.DownloadFile("http://example.com/" + txtbox.Text.ToUpper().ToString(),
                                                  sourceDir + txtbox.Text.ToUpper().ToString() + ".html");
           }
  </code></pre>
  
  <p>Thank you so much.</p>