title: Read FTP file contents to a string in C# FluentFTP
body: <p>My class inherits from FluentFTP and I have created a class like this. I need to create a function called <code>Read</code> in this class. The purpose of the read function is to return a string to me by reading the contents of the files I have read from the FTP line by line. I'll process the rotating string later. Is there a method for this in FluentFTP? Ff there is none, how should I create the function?</p>
  <pre><code>using FluentFTP;
  
  public class CustomFtpClient : FtpClient
  {
      public CustomFtpClient(
              string host, int port, string username, string password) :
          base(host, port, username, password)
      {
          Client = new FtpClient(host, port, username, password);
          Client.AutoConnect();
      }
  
      private FtpClient Client { get; }
  
      public string ReadFile(string remoteFileName)
      {
          Client.BufferSize = 4 * 1024;
          return Client.ReadAllText(remoteFileName);
      }
  }
  </code></pre>
  <p>I can't write like this because the <code>Client</code> I'm writing comes from FTP. Since I derived it from SFTP in my previous codes, I wanted to use a similar code snippet to it, but there is no such code snippet in FluentFTP. How should I perform an operation in the <code>Read</code> function?</p>
  <p>In another file, I want to call it like this.</p>
  <pre><code>CustomFtpClient = new CustomFtpClient(ftpurl, 21, ftpusername, ftppwd);
  var listedfiles = CustomFtpClient.GetListing(&quot;inbound&quot;);
  var onlyedifiles = listedfiles.Where(z =&gt;
      z.FullName.ToLower().Contains(&quot;.txt&quot;) || z.FullName.ToLower().Contains(&quot;940&quot;))
      .ToList();
  
  foreach (var item in onlyedifiles)
  {
      //var filestr = CustomFtpClient.ReadFile(item.FullName);
  }
  </code></pre>