简体   繁体   English

在Asp.net中隐藏命令提示符

[英]Hide Command Prompt in Asp.net

I'm trying to run Rscript in Asp.net web Application using Process.start 我正在尝试使用Process.start在Asp.net Web应用程序中运行Rscript

  Process.Start(@"C:\Program Files\R\R-3.4.0\bin\RScript.exe", @"F:\Project_files\R_script\RandomF_output.R");

this command produces correct output, but it shows command prompt in Browser window. 该命令产生正确的输出,但在“浏览器”窗口中显示命令提示符。 How to hide this command prompt windows from appearing. 如何隐藏此命令提示符窗口以免出现。

Use ProcessStartInfo to start the process and set the CreateNoWindow property to true: 使用ProcessStartInfo启动进程并将CreateNoWindow属性设置为true:

   ProcessStartInfo startInfo = new ProcessStartInfo();
   startInfo.FileName = @"C:\Program Files\R\R-3.4.0\bin\RScript.exe";
   startInfo.Arguments = @"F:\Project_files\R_script\RandomF_output.R";
   startInfo.CreateNoWindow = true;
   Process.Start(startInfo);

You can also set the WindowStyle to ProcessWindowStyle.Hidden 您还可以将WindowStyle设置为ProcessWindowStyle.Hidden

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM