Compare the Read Line and Read Key and Explain The Features of these.
Finally Give Few Examples to complete your Explanation.
Best Wishes
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Apr 20, 2014, 10:41 AM
http://www.blackwasp.co.uk/ConsoleInput.aspx
Joe WilsonPosted Jun 5, 2014, 7:49 AM
Thank you.
Joe WilsonPosted Jun 2, 2014, 2:39 AM
Joe WilsonPosted Jun 2, 2014, 2:38 AM
Bhabani PrasadPosted May 26, 2014, 8:16 AM
VulpesPosted May 26, 2014, 7:29 AM
You are therefore prevented from assigning a different value to it at a later stage.
Check the example in MSDN:
http://msdn.microsoft.com/en-us/library/acdd6hb7.aspx
Joe WilsonPosted May 24, 2014, 1:03 PM
Joe WilsonPosted May 10, 2014, 9:19 AM
Joe WilsonPosted May 10, 2014, 9:18 AM
Ranjit PowarPosted Apr 20, 2014, 2:57 PM
ReadKey() method takes a single character and return values of ConsoleKeyInfo structure.
This struct describes console key that was pressed and it also gives the state of modifier keys like SHIFT,CTRL,ALT.
class Program
{
static void Main(string[] args)
{
string s;
s= Console.ReadLine();
Console.WriteLine(s);
ConsoleKeyInfo k = Console.ReadKey();
Console.WriteLine(k.KeyChar );
Console.WriteLine(k.Key);
Console.WriteLine(k.Modifiers );
Console.ReadKey();
}
}
Munesh SharmaPosted Apr 20, 2014, 9:03 AM
Read() :accept the string value and return the string value.
Readline() :Accept the string and return Integer
ReadKey() : Accept the character and return Character
Declaration In Application: