在C#中我得到了一个随机的Win32Exception。我是一个经验丰富的C#程序员,但这是随机的!文件"quickbms.exe“确实存在!
当我这么做的时候
commandPrompt.StartInfo.FileName = "start";
commandPrompt.StartInfo.Arguments = "\"" + Application.ExecutablePath + "\\src\\quickbms.exe\" -o \"src\\overworld.bms\" \"savegame_d.dat\" \"src\\xbla\\Savegame_Files\\regions\"";
commandPrompt.Start();
commandPrompt.WaitForExit();(commandPrompt = System.Diagnostics.Process)
发生了这种情况(使用了自定义异常窗口):
http://gyazo.com/9ebe6832f6200669d20c0c4e96e95a9c
你们很多人会说“文件不存在”,但它确实存在!
http://gyazo.com/a976d29109775512695c4bcc177ef5ad
发布于 2014-05-20 19:39:27
问题是你的“开始”论点。
commandPrompt.StartInfo.FileName = "start";没有名为start的windows命令。Win+R + "start“= error如果删除参数行,您将得到完全相同的错误。
您应该直接在Filename中调用该文件,而不是插入参数。
commandPrompt.StartInfo.FileName = "\"" + Application.ExecutablePath + "\\src\\quickbms.exe\";
commandPrompt.StartInfo.Arguments = "-o \"src\\overworld.bms\" \"savegame_d.dat\" \"src\\xbla\\Savegame_Files\\regions\"";
commandPrompt.Start();
commandPrompt.WaitForExit();https://stackoverflow.com/questions/23768228
复制相似问题