c# programming hands on lab v1
TRANSCRIPT
C# Programming Guide
Mr.Suttipong Kullawattana
To create and run a console application• Start Visual Studio.• 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.• In the Name box, specify a name for your project, and then choose the OK button.• The new project appears in Solution Explorer.• If Program.cs isn't open in the Code Editor, open the shortcut menu
for Program.cs in Solution Explorer, and then choose View Code.• Replace the contents of Program.cs with the following code.
Choose the F5 key to run the project. A Command Prompt window appears that contains the line Hello World!
Comment
Main Method
Input & Output
General Structure of a C# Program
Classes (C# Programming Guide)
Structs (C# Programming Guide)
Namespaces
Interfaces
Interfaces
How to: Implement Interface Events
An interface can declare an event. The following example shows how to implement interface events in a class. Basically the rules are the same as when you implement any interface method or property.
To implement interface events in a class• Declare the event in your class and then invoke it in the appropriate areas.