title: Download full directory with subdirectories with FTP C#
body: <p>How can I download a full directory from the ftpserver?</p>
  
  <p>I can download with this 1 file:</p>
  
  <pre><code>try
          {                
              string strUri = strDsiteAdres+ "//" + file+"/";
              Uri serverUri = new Uri(strDsiteAdres);
              if (serverUri.Scheme != Uri.UriSchemeFtp)
              {
                  return;
              }       
              FtpWebRequest reqFTP;
              reqFTP = (FtpWebRequest)FtpWebRequest.Create(strUri);                                
              reqFTP.Credentials = new NetworkCredential(strDusername, strDpassword);                
              reqFTP.KeepAlive = false;                
              reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;                                
              FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
              Stream responseStream = response.GetResponseStream();
              FileStream writeStream = new FileStream(strPath +"/"+ file, FileMode.Create);                
              int Length = 2048;
              Byte[] buffer = new Byte[Length];
              int bytesRead = responseStream.Read(buffer, 0, Length);               
              while (bytesRead &gt; 0)
              {
                  writeStream.Write(buffer, 0, bytesRead);
                  bytesRead = responseStream.Read(buffer, 0, Length);
              }                
              writeStream.Close();
              response.Close(); 
          }
  </code></pre>
  
  <p>Can someone please help me?</p>