title: Retrieving list of FTP file names only, without additional details
body: <p>I'm trying to download the contents of an FTP folder to a local folder using a this example on StackOverflow:<br>
  <a href="https://stackoverflow.com/questions/20518297/downloading-a-list-of-files-from-ftp-to-local-folder-using-c">Downloading a list of files from ftp to local folder using c#?</a></p>
  
  <p>The code I have at the moment is:</p>
  
  <pre><code>public void DownloadFilesFromFTP(string localFilesPath, string remoteFTPPath)
  {
      remoteFTPPath = "ftp://" + Hostname + remoteFTPPath;
      var request = (FtpWebRequest)WebRequest.Create(remoteFTPPath);
  
      request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
      request.Credentials = new NetworkCredential(Username, Password);
      request.Proxy = null;
  
      FtpWebResponse response = (FtpWebResponse)request.GetResponse();
      Stream responseStream = response.GetResponseStream();
      StreamReader reader = new StreamReader(responseStream);
      List&lt;string&gt; directories = new List&lt;string&gt;();
  
      string line = reader.ReadLine();
  
      while (!string.IsNullOrEmpty(line))
      {
          directories.Add(line);
          line = reader.ReadLine();
      }
      reader.Close();
  
      using (WebClient ftpClient = new WebClient())
      {
          ftpClient.Credentials = new System.Net.NetworkCredential(Username, Password);
  
          for (int i = 0; i &lt;= directories.Count - 1; i++)
          {
              if (directories[i].Contains("."))
              {
  
                  string path = remoteFTPPath + @"/" + directories[i].ToString();
                  string trnsfrpth = localFilesPath + @"\" + directories[i].ToString();
  
                  ftpClient.DownloadFile(path, trnsfrpth);
              }
          }
      }
  
      response.Close();
  }
  </code></pre>
  
  <p>I'm receiving a path not supported exception and when I inspect the values of my variables <code>path</code> and <code>trnsfrpth</code> they appear to be including Apache information.</p>
  
  <blockquote>
    <p><strong>path:</strong> <a href="ftp://hostname/data/resourceOrders/-rw-r--r--" rel="noreferrer">ftp://hostname/data/resourceOrders/-rw-r--r--</a>   1 apache<br>
    apache        367 Jul 16 14:07 resource-orders-1437019656813-893.json</p>
  </blockquote>
  
  <p>And</p>
  
  <blockquote>
    <p><strong>trnsfrpth:</strong> V:\code.runner\local\orders-rw-r--r--   1 apache   apache<br>
    367 Jul 16 14:07 resource-orders-1437019656813-893.json</p>
  </blockquote>
  
  <p>How can I capture just the filename, <code>resource-orders-1437019656813-893.json</code> without a hacky (<code>rightof()</code>, for example) approach?</p>