Tag: ubuntu

从Mono C#运行Bash命令

我试图使用此代码创建一个目录,以查看代码是否正在执行但由于某种原因它执行没有错误,但目录永远不会。 我的代码在某处有错误吗? var startInfo = new var startinfo = new ProcessStartInfo(); startinfo.WorkingDirectory = “/home”; proc.StartInfo.FileName = “/bin/bash”; proc.StartInfo.Arguments = “-c cd Desktop && mkdir hey”; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardOutput = true; proc.Start (); Console.WriteLine (“Shell has been executed!”); Console.ReadLine();