title: Text file only reading odd OR even lines?
body: <p>I'm trying to write a little C# program that reads from a text file and lets you choose a line to print out.</p>
  
  <p>For some reason, it will only print lines 1,3,5,etc.</p>
  
  <p>If I change the bit that says <code>int chooseLine = Convert.ToInt32(input);</code> to <code>int chooseLine = (int)Convert.ToInt64(input);</code>, then it only prints even lines.(0,2,4,6,etc).</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.IO;
  class Steve
  {
      public static int count = 0;
      public static String[] steveTalk;
      public static void Main()
      {
          using (StreamReader r = new StreamReader("Steve.txt"))
          {
              string line;
              while ((line = r.ReadLine()) != null)
              {
                  count++;
              }
          }
          using (StreamReader sr = new StreamReader("Steve.txt"))
          {
              int i = 0;
              steveTalk = new String[count];
              String line;
              while ((line = sr.ReadLine()) != null)
              {
                  steveTalk[i] = line;
                  Console.WriteLine(steveTalk[i]);
                  i++;
              }
          }
          while (true)
          {
              string input = Console.ReadLine();
              int chooseLine = Convert.ToInt32(input);
              try
              {
                  Console.WriteLine(steveTalk[chooseLine]);
              }
              catch
              {
                  Console.WriteLine("Error! Not a number or array index out of bounds");
              }
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <p>Any ideas?</p>