المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Accepting user inputs in a console app.



C# Programming
05-07-2009, 11:50 PM
Hello,

I am writing a small console application which will accept user age and name under the Public void Accept_Details() function. Now I want that, on the basis of the input provided by the user in the public void Display_Details() function, he be shown the desired output. Like this:

Console.WriteLine("Enter your choice. Type 'age' to view user age or 'name' to view user name);

Now, if the user enters 'age', he will be shown this:

Console.WriteLine("User Age is: {0}", age);

Similar will be the case, if the user enters 'name'. How to do that?

Please help me out,
sorry for my poor english,
Rajdeep.NEThttp://www.barakasoft.com/script/Forums/Images/rose.gif