Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string strpath = MapPath(@"~\App\AcmeCADConverter");//放在站点目录不用设置过多的权限
string stroutpath = MapPath(@"~\Out");     //输出目录也放在站点下面
string strinpath = MapPath(@"~\Infiles\");   //文件也放在站点目录下面
string commandText = strpath + @"\AcmeCADConverter /r /e /w 1280 /h 800 /f 2 /d " + stroutpath + " " + strinpath + "test.dwg";  //要执行的cmd命令
p.Start();
p.StandardInput.WriteLine(commandText);
p.StandardInput.WriteLine("exit");
p.WaitForExit();
p.Close();

Response.Write("执行完成");
View Code

相关文章:

  • 2021-12-16
  • 2022-02-27
  • 2022-03-01
  • 2021-10-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-12
  • 2021-11-30
  • 2021-12-06
  • 2021-12-16
  • 2021-12-10
  • 2019-05-27
相关资源
相似解决方案