Now these days .NET is a most powerful and easy, to develop windows applications. This is blog helps you to develop .NET applications for basic .NET application developers. Here., these postings are truly working and sources codes of the applications also available. we think these are helps to you to learn yourself about .NET and develop your own applications. let's try...

Code for Console Applications


What is Console Application:


A console application is an application that runs in a console window same as a C and C++ program.It doesn’t have any graphical user interface. Console Applications will have character based interface.To work with console applications in .NET you have to use a class called Console that is available within the namespace System, which is the root namespace.

Console Application in C#


To read a line of text from the console window, you use the Console.ReadLine() method.
This will read an input stream  from the console window and return the input string when user presses the Enter Key.

There are also two methods for writing to the console, which are used extensively

  • Console.Write() — Writes the specified value to the console window.
  • Console.WriteLine() — This does the same, but adds a newline character at the end of the output.
Example:
The below C#.NET code lets the user input a line of text and displays that text

string s = Console.ReadLine();
Console.WriteLine(s);

No comments:

Post a Comment