To read and write from the console, use Console.Read, Console.ReadLine, Console.Write, Console.WriteLine.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| namespace ReadWriteConsole { class Program { static void Main() { Console.Write( "This " ); Console.WriteLine( "is all on one line." ); Console.Write( "Enter your name: " ); string name = Console.ReadLine(); Console.WriteLine(name); Console.Read(); // pause } } } |