调试目标改成一个bat文件 bat里调用你的编译输出之后再调用别的
在你想调用的地方调用 Process proc = null; try { string targetDir = string.Format(@"D:\BizMap\");//this is where testChange.bat lies proc = new Process(); proc.StartInfo.WorkingDirectory = targetDir; proc.StartInfo.FileName = "testChange.bat"; proc.StartInfo.Arguments = string.Format("10");//this is argument //proc.StartInfo.CreateNoWindow = true; //proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;//这里设置DOS窗口不显示,经实践可行 proc.Start(); proc.WaitForExit(); } catch (Exception ex) { Console.WriteLine("Exception Occurred :{0},{1}", ex.Message, ex.StackTrace.ToString()); }
110,537
社区成员
642,576
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧