簡體   English   中英

執行命令程序

[英]Execute command program

在C#中執行控制台命令程序時出現以下錯誤

'CutyCaptApp.vshost.exe' (Managed (v4.0.30319)): Loaded  C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'CutyCaptApp.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'vshost.NotifyLoad' (0x19a4) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x6ac) has exited with code 0 (0x0).
'CutyCaptApp.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Srinivasa\VisualStudioProject\CutyCaptApp\CutyCaptApp\bin\Debug\CutyCaptApp.exe', Symbols loaded.
The thread '<No Name>' (0x1d3c) has exited with code 0 (0x0).

這是我的C#代碼:

static void Main(string[] args)
{
   Process process = new System.Diagnostics.Process();
   ProcessStartInfo startInfo = new ProcessStartInfo();
   startInfo.FileName = "C:\\Srinivasa\\VisualStudioProject\\CutyCapt_Pdf_Code\\release\\CutyCapt.exe";
   //startInfo.Arguments = f;
   Process.Start(startInfo);
   //startInfo.FileName =    "C:\\Srinivasa\\VisualStudioProject\\CutyCapt_Pdf_Code\\release\\CutyCapt.exe";    startInfo.Arguments = "--url=C:/Users/UPPALASX/Desktop/New folder/ResearchMap.html --out=C:\\Srinivasa\\VisualStudioProject\\CutyCapt_Pdf_Code\\release\\Out_Embeded_RM.png";
   process.StartInfo = startInfo;
   process.Start();
   process.WaitForExit();
}

錯誤從哪里來?

您在其中一個參數的文件夾路徑中有一個空格,因此它將被解釋為兩個參數。 參數由空格分隔,因此,如果參數包含空格,則必須用雙引號將其引起來。

我在您的輸出中看不到任何錯誤。 該應用程序的行為可能不符合您的預期,但是並沒有引發明顯的錯誤。

您是否嘗試過使用命令行中的參數而不是應用程序來運行CutyCapt.exe程序,以檢查其是否在這些參數下運行正常?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM