FANDOM


CSharp
 

Hello, welcome to my first tutorial on this wiki!

We will start with the traditional Hello World program:).

Here we go:

1.Make new project in Visual Studio, you can choose Windows Forms or Console Application.

Windows Forms:Edit

2.Open Toolbox(usually on right side of window)

3.Add Button, click on it and write text.

4.Double click that Button=>this will add Button click event to your application.Event are used to do something when something happens on GUI(like when you click on button, Message Box shows)

5.Now write this line of code in this event you made few moments ago:

  MessageBox.Show("Hello, World!!");

6.Run you application and click the button!

Console ApplicationEdit

2.When you class opens add this line code in Main method(this is method that run automatically after running program)

  Console.WriteLine("Hello, World!!");

3.Write this line to stop application until you click something or press CTRL + F5:

Console.ReadLine();

Or

Console.Read();

Or

Console.ReadKey();

4.Run you application and see the result!


You completed your first C# program, I'm so proud of you!:)

Have fun!:)