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

مشاهدة النسخة كاملة : How to handle Enter key...



C# Programming
01-30-2010, 01:00 AM
Please go through...

class Test
{

Console.WriteLine("1:Add\n2:Sub\n3:Mult:\n4:Div");
Console.WriteLine();
Console.WriteLine("Press 9 to Exit or Enter to Continue ");

string s=Console.ReadLine();

....

}
My query is that when I enter the "ENTER" key, it does go ahead but it also does the same for the other keys except 9, for which it exits from the Program.

Hope so I will get a solution