C# Basics
Lab Guides
Document Code 25e-BM/HR/HDCV/FSOFT
Version 1.1
Effective Date 20/11/2012
Hanoi, 06/2019
Lab Guides C# Basics Issue/Revision: x/y
RECORD OF CHANGES
No Effective Date Change Description Reason Reviewer Approver
1. 01/Oct/2018 Create new Draft
2. 01/Jun/2019 Update template Fsoft DieuNT1
template
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 2/6
Lab Guides C# Basics Issue/Revision: x/y
Contents
Day 1. Lab 1: Hello World!................................................................................................................................ 4
Objectives:.................................................................................................................................................... 4
Prerequisites:................................................................................................................................................ 4
Problem Description:.................................................................................................................................... 4
Guidelines:.................................................................................................................................................... 4
Step 1: Open Visual Studio....................................................................................................................... 4
Step 2: Create New Project – Console Application...................................................................................4
Step 3: Edit [Link] file...................................................................................................................... 5
Step 4: Run Code..................................................................................................................................... 6
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 3/6
Lab Guides C# Basics Issue/Revision: x/y
CODE: Net.S.L001
TYPE: SHORT
LOC: 15
DURATION: 10 MINUTES
Day 1. Lab 1: Hello World!
Objectives:
Understand about create, edit and run C# basic program on Visual Studio.
Prerequisites:
Download and installs Visual Studio (included .NET).
Problem Description:
Write a C# console application to show Hello World message.
Use the [Link] statement to print the message to console.
Guidelines:
Step 1: Open Visual Studio
Start Visual Studio from Start button
Step 2: Create New Project – Console Application
On the menu bar, choose File> New> Project. The New Project dialog box opens
Expand Installed, expand Templates, expand Visual C#, and then choose Console Application.
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 4/6
Lab Guides C# Basics Issue/Revision: x/y
In the Name box, specify a name for your project, and then choose the OK button. The new project appears
in Solution Explorer.
Step 3: Edit [Link] file
If [Link] isn't open in the Code Editor, open the shortcut menu for [Link] in Solution Explorer,
and then choose View Code.
Replace the contents of [Link] with the following code.
//// A Hello World! program in C#.
using System;
namespace HelloWorld
class Program
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 5/6
Lab Guides C# Basics Issue/Revision: x/y
static void Main(string[] args )
//// Write message to console window
[Link]("Hello World!");
[Link]("Press any key to exit.");
//// Keep the console window open in debug mode.
[Link]();
Step 4: Run Code
Press the F5 key to run the project.
Outputs
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 6/6