title: How to read text line by line in HttpPostedFile
body: <p>I am developing an API where the file is received a file in HttpPostedFile so I want to read the lines and iterate over the all lines:</p>
  
  <pre><code>public IList&lt;string&gt; ReadTextFileAndReturnData(HttpPostedFile file)
  {
     IList&lt;string&gt; _responseList = new List&lt;string&gt;();
  
     //string result = new StreamReader(file.InputStream).ReadToEnd();
     // Not sure how to get all lines from Stream
     foreach (var line in lines)
     {
        // This is what I want to do
        // IList&lt;string&gt; values = line.Split('\t');
        // string data = values[0];
        // _responseList.Add(data);
  
     }
      return _responseList;
  }
  </code></pre>