Monday, December 22, 2014

C# Language Basics

11:38 PM - By azeheruddin khan 0

How to create a console application in C#.NET

1) Select New Project.



2) Below image showing different types of project, you can choice anyone project from the option.


3)  You will see solution explorer right hand side. There you will see project you selected.
      Click on program.cs.

Here, the namespace: CSharpStructure is name of the project. The name of the project must always start with a capital letter otherwise ‘@’ gets added to the namespace, if the name of the project starts with small letter. Program is a class present in this namespace and it is a part of Program.cs file, which is the source code file of a C#.NET program.




C# Program structure


Every program developed using C#, is treated as a project. The class ‘Program_Structure’  belongs to the namespace: CSharpStructure. The execution of the program begins from the main() method. The method: WriteLine() prints output on the output console window and places cursor on the next line, this method belongs to the Console class of System namespace. The method: ReadLine() is used to read input from keyboard. This method is used in the above program to prevent it from terminating as soon as its execution is completed so that, we can see the output. In the above given output window, you can see the cursor waiting for some input through keyboard.



using System; namespace CSharpstructure { class Program_Structure { static void Main(string[] args) { Console.WriteLine("Welcome to C# programming"); Console.ReadLine(); } } }



Output:








About the Author

I am Azeheruddin Khan having more than 6 year experience in c#, Asp.net and ms sql.My work comprise of medium and enterprise level projects using asp.net and other Microsoft .net technologies. Please feel free to contact me for any queries via posting comments on my blog,i will try to reply as early as possible. Follow me @fresher2programmer
View all posts by admin →

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

adsense

© 2014 Fresher2Programmer. WP Theme-junkie converted by Bloggertheme9
Powered by Blogger.
back to top