得到错误:
“该系统找不到指定的文件”
尝试使用Process.Start()
. 它在我的电脑上运行良好,但在服务器上部署时出错。请帮帮我。谢谢。
下面是我的代码:
public void CompileJava(string path, string Qid)
{
Process jcprocess = new Process();
jcprocess.StartInfo.WorkingDirectory = path;
jcprocess.StartInfo.FileName = "javac";
jcprocess.StartInfo.Arguments = path+"Main.java";
lbl_Test.Text = jcprocess.StartInfo.Arguments.ToString();
jcprocess.StartInfo.UseShellExecute = false;
jcprocess.StartInfo.RedirectStandardInput = true;
jcprocess.StartInfo.RedirectStandardOutput = true;
jcprocess.StartInfo.RedirectStandardError = true;
jcprocess.StartInfo.CreateNoWindow = true;
jcprocess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
jcprocess.Start();
}
LEATH
相关分类