Lars Nilsson

Lars Nilsson

  • NA
  • 6
  • 8.5k

C# integer from text file

Aug 8 2010 4:27 PM
Hey guys,

Im new here and I need your help, please.

Im working on something that uses the Paint event in Visual C# 2010, and I need to draw a rectangle. The rectangle can only be drawn by integer values in it,
and I got these integer values in a text file. So what I need to do is to read the integer from either row 2 or row 3 in the text file and assign that value to an integer in the program.
How can I do that?

I heard something about Console.ReadLine(); but it just works with strings, also I tried Console.Read(); which just read one character (i guess) without that I specified what line it should
read from. Im kind of confused.

Please help.

By the way, I use framework 2.0 as goal, so all my friends can try the program later.

- Lars.

Answers (3)