知道怎么调用编译器的CSC *.csc的进来(所有的分全给上了) C#我现在把文件名读到listBox里面了,现在怎么才能调用编译器把我选择的.cs文件进行编译,并且把编译结果放到.txt文件里,先谢谢各位了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先配置好csc.exe的Path环境变量,然后就可以这样写了:System.Diagnostics.Process.Start("cmd.exe","/c csc /t:library /r:System.dll /r:System.Web.dll /out:Test.dll Test.cs"); string cmdline = @"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe " + @"/out:" + csfileName + @".dll " + csfileName + " >> " + csfileName+ @".txt";System.Diagnostics.Process process = new System.Diagnostics.Process();process.StartInfo.FileName = "cmd.exe";process.StartInfo.UseShellExecute = false;process.StartInfo.RedirectStandardInput = true;process.StartInfo.RedirectStandardOutput = true;process.StartInfo.RedirectStandardError = true;process.StartInfo.CreateNoWindow = true;process.Start();process.StandardInput.WriteLine(cmdline); 为什么我写照网上写的设置文件夹权限的代码没有效果? 用OWC生成折线图的时候,怎样去掉节点和控制线条颜色。 隐藏托盘图标的问题!!希望得到大家的帮助谢谢 在c#中自己做控件 Visual Studio2005与unity blob类型数据存储问题,高手进!! Excel 嵌入问题 帮忙,帮忙,大哥大姐们帮帮忙 小问题:tabPage的名称问题。 200分请教真正的高手①:方法的参数如何选择 請問以下代碼何處有問題,為何每次得到的數組裡的值都不變的???? winform下,只有一个窗体,如何让这个窗体启动后焦点都在这个窗体上?
System.Diagnostics.Process.Start("cmd.exe","/c csc /t:library /r:System.dll /r:System.Web.dll /out:Test.dll Test.cs");
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
process.StandardInput.WriteLine(cmdline);