I have the following error when I try to use the line below.
#### Exception System.IndexOutOfRangeException - 0xa9000000 (1) ####
#### Message:
#### System.IO.StreamReader::Peek [IP: 001c] ####
#### System.IO.StreamReader::ReadLine [IP: 005e] ####
#### CobraTest.Program::LoadSetup [IP: 0047] ####
#### CobraTest.Program::ProgramStarted [IP: 00c6] ####
#### CobraTest.Program::Main [IP: 0015] ####
A first chance exception of type 'System.IndexOutOfRangeException' occurred in System.IO.dll
This is the code line that it fails at:
line = reader.ReadLine();
line is a String variable.
I have a text file similar to an INI file and it fails on the line after “MAXMOISTUR4.5” (This is not the complete file, only part of it)
MAXDEPTH=0.402832001
MINMOISTURE=2.5
MAXMOISTURE=4.5
MINMLEVEL=10
MINWLEVEL=10
WATERACTIVE=True
The file reads OK on a PC and a hex editor shows the CR & LF at the end of each line as expected.