C# language Program Structure
C# programming language Program Structure (way of write a program):
Before we study basic building blocks of the C# programming language, let us look at a bare minimum C#. Program structure so that we can take it as a reference in upcoming chapters.
C#, how to display message in consol, Example:
Console.WriteLine("hello this is my first program.");
A C# program basically consists of the following parts:
- Namespace declaration
- A class
- Class methods
- Class attributes
- A Main method
- Statements & Expressions
- Comments
Now we take an Example for give the message:
1.Open IDE:
2.Go to file menu -> new -> project.
3.Select window and console application. Then give the name of project and click on ok.
Write fallowing code on page and run .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("");
Console.WriteLine("hello this is my first program.");
Console.WriteLine("this is my asp.net tutorials notes");
Console.ReadKey();
}
}
}
Result of this C# Program:
In this program we simple print a message in consol. For print anything on consol we use fallowing commend or instruction with C# program.
Console.WriteLine("hello this is my first program.");
Console.ReadKey();
Here second instruction work as like getch() method in c programming.
Other Asp.net Related post:
- Show grid view row details in to tool.
- Ajax update panel with drop down list
- Select index change in drop down list
- How to archive many selection in drop
- Dynamically create data table and bind
- Example of Templatefield in gridview
- How to fill data into drop down list by Sql.
- Show grid view row details in to tooltip.
- How to Bind Gridview Form database.
- Introduction of Asp.net grid view Control.
- How to use asp ListView control in asp.net:
- how to use Captcha in asp.net Second post
- how to add captcha in Asp.net programming
- Example of DropDownList inside GridView
- Introduction of Asp.net grid view Control.
- Example of Templatefield in asp.net gridview.
- Show gridview Row Details And Give Example.
- Ckeck box list example using javascript in grid.
- Example of DropDownList inside GridView control
- Example of Crystal report(Crystal_report_in asp.net programming )
- How to Make a HTML Table by C# code in asp.net programming
- Example of C# for Bind Data to asp.net Textbox inside gridview control
Learn how to Calculate Running Total, Total of a Column and Row
ReplyDeletesql query for running total
It is nice blog Thank you provide important information and i am searching for same information to save my time Big data hadoop online Training
ReplyDeletecsharp example programs for beginners
ReplyDeletec# program Add Image to Statusbar
nice explanation this articles are more helpful for beginners
ReplyDelete