Because you can't really know how long is each line, there is no easy way to skip a line without reading it first.
Typically you'll have to read all the lines but discard the 2 even lines.
string filePath = @"c:\windows\win.ini";
using (var fileReader = new System.IO.StreamReader(filePath))
{
int lineNo = 1;
string line;
while (true)
{
line = fileReader.ReadLine();
if (line == null) break;
bool oddLine = ((lineNo % 2) == 1);
if (oddLine) Console.WriteLine(lineNo + " " + line);
lineNo++;
}
}
This will output every other line:
1 ; for 16-bit app support
3 [extensions]
5 [files]
7 MAPI=1
9 CMC=1
11 MAPIXVER=1.0.0.1
13 [MCI Extensions.BAK]
15 3gp=MPEGVideo
17 3gpp=MPEGVideo
19 adt=MPEGVideo
21 m2t=MPEGVideo
23 m2v=MPEGVideo