Sign in to follow this  
DragonGeo2

How do I perform console reads?

Recommended Posts

DragonGeo2    100
After learning how to use the "System" object to access pretty much any command that I can access when using the dos or "command" prompt, I am still puzzled. I am able to run programs and call functions using System.Function() but how can I read from the command prompt after these functions and programs are called? Can someone toss me a hint here?

Share this post


Link to post
Share on other sites
Rob Loach    1504
The "System" you're refering to isn't an object. System is a namespace in which the Console class resides:

System.Console.Write("Enter your name: ");
string name = System.Console.ReadLine();

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this