title: Trying to download from a dynamic link with C#
body: <p>I need some help to download a file from a link that is half unknown. Admitting we have this website www.website.com/fileX_Y.txt and X , Y are two int between 0 and 20. I gave it a try and my code will keep creating files and replacing older one by a empty one so I cant figure out the correct one. Sorry for my bad english :D
  ''</p>
  
  <pre><code>using System;
  using System.IO;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Net;
  using System.ComponentModel;
  using System.Threading.Tasks;
  
  namespace ConsoleApp13
  {
      class Program
      {
          static void Main(string[] args)
          {
              for (int i = 0; i &lt; 20; i++)
              {
                  for (int x = 0; x &lt; 20; x++)
                  {
                      for (int y = 0; y &lt; 20; y++)
                      {
                          string uri = "lieen" + x + "_ " + y + ".extension";
                          string path = "C:\\json\\" + x + y + ".txt";
                          WebClient client = new WebClient();
                          try
                          {
                              client.DownloadFile(uri, path);
                          }
                          catch (WebException wex)
                          {
                              if (((HttpWebResponse)wex.Response).StatusCode == HttpStatusCode.NotFound)
                              {
  
                              }
                          }
                      }
  
                  }
              }
          }
      }
  }
  </code></pre>