The cmd command compiles the C # source code using the C # compiler that comes with window
1. Write the C # source file (.cs).
2. Find the C # compiler csc.exe that comes with window. The general path is C:\ Windows\ Microsoft.NET\ Framework\ v4.0.30319 or C:\ Windows\ Microsoft.NET\ Framework64\ v4.0.30319
3. Run cmd as an administrator, otherwise there will be an error denying access to resources. Then run the following command to compile.
4. You can also configure system variables. Use the shortcut key win+break to open the system properties page, and then follow the steps in the figure below. Note that if the path environment variable already exists, it is split with ";" and continues to be added later.
5. Run it directly under the name of csc, as shown below