Code Snippet posted by:
Sabarimahesh | Posted on: 5/11/2012 | Category:
C# Codes | Views: 601 | Status:
[Member] |
Points: 40
|
Alert Moderator
class Program
{
static void Main(string[] args)
{
int a;
ConsoleKeyInfo keypress = Console.ReadKey();
if (keypress.Key == ConsoleKey.Escape)
{
Console.WriteLine("You are pressed Escape");
}
a = keypress.KeyChar;
if (a == 13)
{
Console.WriteLine("You are pressed Enter");
}
keypress = Console.ReadKey();
if (keypress.Key == ConsoleKey.X &&
keypress.Modifiers == ConsoleModifiers.Control)
{
Console.WriteLine("You are pressed CTRL+X");
}
Console.Read();
}
Life is a Race
Thanks & Regards
By
Sabari Mahesh P M