pat

pat

  • NA
  • 5
  • 0

Still have the new programmer smell...This will be easy for you.

Dec 7 2008 6:42 PM
Its frightening how new I am to C# programming...
All i want to do is open a file and the write it on the console window.

using System;
using System.IO;
using System.Collections;
namespace simplerreader
 {
   class Program
   { public static void Main(string[] args)
      {
          string filepath = (@"somepath\bs.txt");
          string read = File.ReadAllText(filepath);
          Console.WriteLine(read); Console.Write("Press any key to continue . . . ");
          Console.ReadKey(true);
       }
     }
}


Result is:
012345678910111213141516171819
Press any key to continue . . .

Why am I getting numbers as the results?

Thank you for any assistance.

Answers (2)