title: How to read a CSV file from FTP using C#
body: <p>I am able to pass the authentication but i am not sure how can i read a CSV file. Link normally from a hard drive i am reading like this . </p>
  
  <pre><code>string[] allLines = System.IO.File.ReadAllLines(@"D:\CSV\data.csv");
  </code></pre>
  
  <p>But how can i read from the ftp . My Ftp path is like that <a href="ftp://ftp.atozfdc.com.au/data.csv" rel="noreferrer">ftp://ftp.atozfdc.com.au/data.csv</a>
  Here is my code to pass ftp authentication.</p>
  
  <pre><code>String ftpserver = "ftp://ftp.atozfdc.com.au/data.csv";
  reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpserver));
  reqFTP.UsePassive = false;
  reqFTP.UseBinary = true;
  reqFTP.Credentials = new NetworkCredential("username", "password");
  reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
  reqFTP.Proxy = GlobalProxySelection.GetEmptyWebProxy();
  FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
  </code></pre>