The Console.ReadLine method only reads what you type in the console. Try the program like you have it, but just put Console.ReadLine() as I wrote it and get rid of Console.Read. If you want to display the name you just read, you could add a line like Console.WriteLine("Hello, {0}", sName); beneath the ReadLine call. I hope this helps and have fun with C# (it's a fun language).
No comments:
Post a Comment