Tips for Beginners to C # (a) Getting Started

Source: Internet
Author: User

Recently taught net knowledge in a training facility. Every day will lead students to learn C # knowledge. I want to keep a record of my daily study notes. It can be used as a reference for beginners in the garden. Also welcome the birds in the garden.

The compiler environment is a Visual Studio 2013 database environment that is SQL Server R2

One: What is the net Platform

In our general sense, the net platform mentioned above actually refers to the NET Framework framework introduced by Microsoft Corporation. It is a technology platform. Using this platform we integrate Microsoft operating system development application software, website. handheld devices, games and more. Net Framework platform consists of three parts

A:visual Studio editing Tools (Ide). This is our tool for developing NET applications

B:CLR (Common Language Runtime) the common language runtime. This is the core of the net run.

The C:BCL (Base class Library) provides a number of class libraries for our easy-to-write net projects.

II: C # programming language

If the net platform is likened to China, then we Chinese communication is not a lot of languages, such as a place has its own dialect, and even a minority of people have their own language. But in a country the official designation of the most mainstream language is Mandarin. There are many languages for applications written on the net platform, such as (C#,f#,j#,visual basic,c++ ...), but the most mainstream development language is the C # language we learn, which is equivalent to Mandarin. That's understandable.

Three: What kind of development can you do with learning net?

1: Desktop program. Desktop program is that we need to download and install the program running in our operating system, such as QQ, Thunder, Storm audio and so on need to double-click Open operating system-based.

2:web application. To be blunt is the development of Web sites, Net-based Web site development is the development of ASP, now the mainstream web development is ASP.

3: Development of the mobile side. Mobile phone development, the most mainstream of the current net platform development is the Windows Phone phone. But the current market share of the mobile phone is lower. If you are interested, you can teach yourself. Oh.

4:unity3d development. Currently the most mainstream mobile game development technology. Virtual reality and mobile games share the highest market. Our training is made by Unity3d original engineers, and each student can experience the most original virtual reality scene with Oculus glasses.

Four: Two modes of software development

A:C/S client/server (client-to-server interaction mode) is actually the operating system above must install the client software (QQ, Thunderbolt ...). ), and then connect to the server. WinForm WPF.

B:B/S Browser/server (Browser-to-server interaction mode) ASP.

V: Introduction to Visaul Studio

A: Click the Desktop Visual icon

B: On the console (Windows key +r) and enter Devenv.

Open our editing tools we first see such an interface.

We click New Project, then select the C # language, select Windows, and then select a console Application

From the beginning of today, we have to keep the code we have learned under our own folder. And then we look at two places. One is the solution name and the other is the name. Look at the difference between the two names.

First I create the solution name, named YunHeDataDay001. Then take the name to Day001 and save it under our designated folder.

Here it is! One thing to note is that in theory the name and solution name cannot be in Chinese, but you will not be able to write an error. But it is not advisable to do so.

We first shifted our gaze to the far right of the screen, and we saw that the solution name we just created was the name of the solution manager. And the name is the name of the project we just created. This means that a solution contains multiple projects.

Below, let's observe the project, in which there is a file called program, and his suffix is. cs This is actually a class file (we'll cover the class file in detail later).

This file is the document we want to learn.  Let's take a look at the relationship of the project. A solution contains multiple projects, and one project contains multiple classes.

Company-------Solution Department------Project Employee------class file (end of. cs).

Let's take a look at what's in our class file.

A: What is the role of namespaces?  He is the organization of our class files into a collective grammar. For example, there are two in a company called Zhang San. But they are one in the sales department, one in the administration department. So how do we distinguish between these two sheets of three? We can call the Zhang San of the sales department, the Zhang San of the administration department. That way, two sheets of three are separated.

The B:main function is the main entrance to our program. The equivalent of a house. There is a doorway in our house. He is our main entrance into the house. The No of all our programs starts with the main function.

Six: Let's see what happens under our folders?

The first thing we see is the extension called sln, they are the solution file that can be clicked directly to open it, and it will load all the items below.

We see the individual files under this folder, where we first see csproj this file is an abbreviation for the C # project file, which indicates that this is a C # file that contains project information. You can double-click Run.

Seven: Let's go into the first line of code: the legendary Hello world.

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;//introduction of namespaces ibid .namespaceday001//namespace of the current class file{    classProgram//class files are all decorated with classes    {        Static voidMain (string[] args)//Main function, entry of main program{Console.Write ("Hello World");//Print data in the consoleConsole.readkey ();//wait for user input keyboard to pause        }    }}

Conclusion: Every good program ape is composed by writing a lot of code, I hope students can not very stingy with their own computer and keyboard, write code to the marrow, write the essence. All right. We will continue to learn the second day of C # knowledge tomorrow

                                                                                                                                                                                         Teacher: Rocky ren   Henan Cloud and college.

Tips for Beginners to C # (a) Getting Started

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.