已经很久没有更新博客,以后关于个人或者团队在实际中遇到的问题在这里做个记录。
先总结一下C#调用执行exe程序,简单直接上代码
Thread worker = new Thread(delegate () {
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = AppConst.EngineFilePath; //exe程序文件地址
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = false;
p.StartInfo.RedirectStandardOutput = false;
p.StartInfo.RedirectStandardError = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.Arguments = sb.ToString(); //参数 多个参数使用空格分开
p.Start();
p.WaitForExit();
p.Close();
//helper.CsvConvertDataBase(seq);
});
worker.Start();