我正在尝试使用以下代码通过C#运行分类器。在命令行上,这可以正常工作,但在通过C#运行时有一些问题。请看一下
{
...
ProcessStartInfo exeStartInfo = new ProcessStartInfo();
exeStartInfo.WorkingDirectory = @"c:\Program Files\Weka-3-6";
exeStartInfo.UseShellExecute = false;
exeStartInfo.RedirectStandardOutput = true;
exeStartInfo.RedirectStandardError = true;
exeStartInfo.CreateNoWindow = true;
exeStartInfo.FileName = "cmd.exe";
exeStartInfo.Arguments = "java -classpath \"C:\\Program Files\\Weka- 3-6\\weka.jar\" weka.classifiers.bayes.NaiveBayes -t data\\iris.arff -i > c:\\users \\A\\Desktop\\out.txt";
Process comd_line;
using (comd_line = new Process())
{
comd_line.StartInfo = exeStartInfo;
comd_line.Start();
}
comd_line.Dispose();
comd_line.Close();
}