CSharpCompiler
CSharpCompiler 是免費開源的 C# 編譯器,可編譯 C# 源代碼。
示例
CSharpCompiler compiler = new CSharpCompiler ();
compiler.SourceCode = richTextBox1.Text;
compiler.Output = CSharpCompiler.OutputType.EXE;
compiler.Path = "C:\\Users\\Danny\\Desktop";
compiler.NameOfAssembly = "Hello World!";
compiler.CompileCode();if (compiler.SuccessfullCompilation == false )
{
if (compiler.CompilerErrors != null )
listBox1.Items.AddRange(compiler.CompilerErrors);
if (compiler.CompilerWarnings != null )
listBox1.Items.AddRange(compiler.CompilerWarnings);
}
評論
圖片
表情
