Student 含有main 方法。
Person没有main方法。
Student是Person的子类。
进入cmd命令
进入想编译的文件所在文件夹
编译文件生成.exe
敲入 csc Program.cs
- csc Student.cs Person.cs
- csc *.cs
- csc /t:exe Student.cs Person.cs
第一个是第三个的缩写。(/t is for target)
编译文件生成.dll
敲入
csc /t:library Person.cs
或者
csc /t:library *.cs
编译.exe引用同文件夹下的.dll
敲入
csc /t:exe Student.cs /r:Person.dll
csc /t:exe Student.cs /r:file1.dll;file2.dll;file3.dll
编译.exe 时 指定.exe 的文件名称
敲入
csc /out:App.exe Student.cs Person.cs
如果没有out 参数的话 编译成的.exe文件名称会和包含main方法的类名称一样
如果编译的Student.cs 和 Person.cs中同时都有main方法时
敲入
csc Student.cs Person.cs /main:Student
( 读书有感,待续)