C # concise tutorial
Establish the first C # project (Project)
This article will take a step to guide you to complete your first C # project.
Step 1: Production of an empty C # project
Select File-> New-> Project-> Visual C # Projects-> Visual C # Projects-> Visual C # Projects-> Empty Project. Add your project name and select a suitable directory through the Browse button. As shown below:
Step 2: Add an empty class to it
Right-click your project in Solution Explorer and click Add-> Add Class
You will see this dialog box below. Here, you can add a variety of classes to your project. We now add a C # class. Fill in the name of your class and click Open.
Now, you have added a class for your project. Visual Studio generates a framework for your class, just like this:
Namespace DownloadWeb {Using System; ///
Step 3: Add functions to class
It is now added to the class now. Insert the following code, add a few functions, and call them in the main function.
Namespace DownloadWeb {USING SYSTEM; ///
// Call class McClass from Main
Public class class1 {static void main () {mcclass sq = new mcclass (); console.writeline (sq.square (8) .tostring ()); console.writeline (SQ.Add (8.3, 9.24) .tostring () ); Console.writeline (Sq.Multiply (5, 8) .tostring ()); console.writeline (Sq.Subtract (22, 42) .tostring ());}}}
Step 4: Establish and run the project