How to get the position or line throwing exception
I just started learning the IO class and i would like to know How to get the position or line throwing exception while reading the text file and display the message? I would be thankful if you could help me out.

ali tuncerRank #1,499 · 1.1K reputationPosted Apr 24, 2016, 5:36 PM EDT
put another variable to count linenumber :
while(txtIn.Peek() !=-1)
{
if(col[0].Length < 5)
{
}
else
{
Console.WriteLine(linenumber) // this line does not get included
}
linenumber++;
}
Rahul ChavanRank #2,671 · 521 reputationPosted Apr 21, 2016, 1:03 AM EDT
Nepethya RanaRank #4,361 · 348 reputationPosted Apr 21, 2016, 1:43 AM EDT
Nepethya RanaRank #4,361 · 348 reputationPosted Apr 21, 2016, 1:45 AM EDT