title: Read/Write text file progressbar in C#
body: <p>I have a function which reads a big text file,splits a part(from a given start and end),and save the splitted data into another text file.since the file is too big,i need to add a progressbar when reading the stream and another one when writing the splitted text into the other file.Ps.start and end are given datetime!!</p>
  
  <pre><code>using (StreamReader sr = new StreamReader(file,System.Text.Encoding.ASCII))
  {
      while (sr.EndOfStream == false)
      {
          line = sr.ReadLine();
  
          if (line.IndexOf(start) != -1)
          {
              using (StreamWriter sw = new StreamWriter(DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + "cut"))
              {
                  sw.WriteLine(line);
                  while (sr.EndOfStream == false &amp;&amp; line.IndexOf(end) == -1)
                  {
                      line = sr.ReadLine();
                      sw.WriteLine(line);
                  }
              }
  
              richTextBox1.Text += "done ..." + "\n";
              break;
          }
      }
  }
  </code></pre>