title: Read line from text file skipping read lines
body: <p>I am reading from a text file line by line.</p>
  
  <pre><code>StreamReader reader = new StreamReader(OpenFileDialog.OpenFile()); 
  
  // Now I am passing this stream to backgroundworker
  backgroundWorker1.DoWork += ((senderr,ee)=&gt;
  {
      while ((reader.ReadLine()) != null)
      {
          string proxy = reader.ReadLine().Split(':').GetValue(0).ToString();
          // here I am performing lengthy algo on each proxy (Takes 10 sec,s) 
      }
  });
  backgroundWorker1.RunWorkerAsync();
  </code></pre>
  
  <p>Now problem is that some lines are not being read. It skips each line after one line read.</p>
  
  <p>I have read the total number of lines using </p>
  
  <pre><code>File.ReadAllLines(file.FileName).Length
  </code></pre>
  
  <p>It gives accurate number of lines.</p>
  
  <p>I suspect there is some problem with BackgroundWorker mechanism in my code, but can't figure it out.</p>