DoxBox 从 C# 开始
DoxBox start from C#
我尝试从我的控制台应用程序启动 DoxBox,但它什么也没做。什么是问题?
Process proc = new Process();
ProcessStartInfo startinfo = new ProcessStartInfo();
startinfo.UseShellExecute = false;
startinfo.WorkingDirectory = "C:\Program Files (x86)\DoxBox";
startinfo.FileName = "cmd.exe";
string strComm = "DoxBox.exe /dismount H:";
startinfo.Arguments = strComm;
proc.StartInfo = startinfo;
proc.Start();
为什么要从 cmd.exe
开始这个过程?
它不在您的 C:\Program Files (x86)\DoxBox
目录中,我敢肯定。
提供 FileName
中的 DosBox 文件,根本没有 cmd.exe
:
Process proc = new Process();
ProcessStartInfo startinfo = new ProcessStartInfo();
startinfo.UseShellExecute = false;
startinfo.WorkingDirectory = "C:\Program Files (x86)\DoxBox";
startinfo.FileName = "DoxBox.exe";
string strComm = "/dismount H:";
startinfo.Arguments = strComm;
proc.StartInfo = startinfo;
proc.Start();
我尝试从我的控制台应用程序启动 DoxBox,但它什么也没做。什么是问题?
Process proc = new Process();
ProcessStartInfo startinfo = new ProcessStartInfo();
startinfo.UseShellExecute = false;
startinfo.WorkingDirectory = "C:\Program Files (x86)\DoxBox";
startinfo.FileName = "cmd.exe";
string strComm = "DoxBox.exe /dismount H:";
startinfo.Arguments = strComm;
proc.StartInfo = startinfo;
proc.Start();
为什么要从 cmd.exe
开始这个过程?
它不在您的 C:\Program Files (x86)\DoxBox
目录中,我敢肯定。
提供 FileName
中的 DosBox 文件,根本没有 cmd.exe
:
Process proc = new Process();
ProcessStartInfo startinfo = new ProcessStartInfo();
startinfo.UseShellExecute = false;
startinfo.WorkingDirectory = "C:\Program Files (x86)\DoxBox";
startinfo.FileName = "DoxBox.exe";
string strComm = "/dismount H:";
startinfo.Arguments = strComm;
proc.StartInfo = startinfo;
proc.Start();