c # special treatment - first met c #

Mentioned in c #, I have to say .net, .net is a platform developed by Microsoft, in short, on this platform, you can write, run the program. Many people may find this platform very far away from us, it is not true, the platform has been in our windows operating system, quietly providing the service for us. After so many years of development, .net platform has reached version 4.7. Specific points, .net platform here
The path C: \ Windows \ Microsoft.NET
Framework is .net framework Framework and Framework64 here are 32-bit and 64-bit folders, only 32-bit operating system Framework folder, no Framework64. What two folders stored in almost all the same, as
Two folders are stored in different versions .net 32-bit and 64-bit.
How to use this platform? I am here as an example to the 64-bit version of 4.0. Open this folder.
Csc can find a program called, this program is our compiler, other versions of the folder also have this program. We can use the compiler to compile the source code into an executable file. For example, I am here to write a program:
Create a new text in the current directory, write the code
This code means that the output "Hello World", which is a traditional learning program, the first program must write "Hello World". Now you do not need to understand this process, let me talk to you about the principles of compilation.
First, the file extension was changed to cs, c sharp is meant to illustrate this is a c # file. Here it is necessary to say something, c # reading method is "c & Poor's evil" is not a "c Well" ah!
Since I installed the IDE, so the icon has changed, do not control this. You can see, I have extensions changing for the better. Then open the console Ankuaichajian win + r open operation, in which the transport type cmd
 
We knock command, cd C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319, the meaning of this command is to jump to the directory C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319, we want to jump where can write cd plus path, this time to jump here because where were stored the source files. You and I may not the same version, so the jump is not the same directory, modify their own on the line.
After the jump we continue to knock csc hello.cs, and then return, meaning that the phrase command, with the csc compiler hello.cs
After Qiaowan following the emergence of a lot of information, we just go take a look at the folder
Find more than a exe file, which is compiled executable files. We opened it.
The program we have compiled, and this step is complete compiler, the exe file can take the matter to the people directly, although nothing function, but as the first program we wrote it is not very memorable ?
Some students may want to ask, we can only have csc in this folder to write it? Of course not, we can write the program in any place, for example, I wrote a desktop, we jump to the desktop directory. And then began to compile, found not
Csc not suggest that an internal or external command, this is because this directory is not csc file, so the system can not find the csc where, so I failed. So we have to tell the system where csc, is to configure the environment variables.
We csc file path copy it
Right-click Computer, click Properties, then click Advanced System Settings.
Click Environment Variables
Path found in the system variables and double-click to open
After opening win7 and win10 systems are not the same, win10's simpler, different environment variables column view, plus a column like myself, just copy the path to be added, such as C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319, I use win7 Screenshot
win7 in the variable values ​​are written in a small box, separated by a semicolon (English semicolon) between different environment variables, so we need to add a semicolon at the end of the line variable, and then just copy paste the path.
Well all the way to determine just fine. Environment variable configuration Well let's try again.
Successful, the program can now be written anywhere in the system.
 
ps: this article is to make you understand c # compiler principles, the future does not need to use the IDE development environment configuration variables. 

Guess you like

Origin www.cnblogs.com/hmswt/p/11294246.html