提问人:Arthur Valenca 提问时间:2/17/2023 最后编辑:Arthur Valenca 更新时间:7/23/2023 访问量:92
Process.Start() 模拟器和命令行
Process.Start() Emulator and command line
问:
我正在使用 .启动进程以运行模拟器和模拟器打开游戏的命令行,但是当我运行它时,它会打开模拟器,但没有命令行和在列表框中选择的游戏,有人会对此命令行有任何想法。
命令行参数: -L “核心\genesis_plus_gx_libretro.dll”
private void StartGame()
{
string rom = @"ROMFILES\" + RomfilesList.Text.ToString() + ".zip".ToString();
string emulator = @"EMULATOR\retroarch.exe";
string commandline = @"-L cores\genesis_plus_gx_libretro.dll" + rom;
if (!File.Exists(emulator))
{
MessageBox.Show("Emulator is required to continue.", "ERROR", MessageBoxButtons.OK,MessageBoxIcon.Error);
}
if (File.Exists(emulator))
{
Process.Start(emulator, "\"" + commandline);
}
}
答:
0赞
Ayman Alhaj
7/23/2023
#1
看起来在构造命令行字符串时存在一个小问题。命令行变量在内核路径和 ROM 文件之间缺少空格。
试试这个
private void StartGame()
{
string rom = @"ROMFILES\" + RomfilesList.Text.ToString() + ".zip";
string emulator = @"EMULATOR\retroarch.exe";
string corePath = @"cores\genesis_plus_gx_libretro.dll";
string commandline = "-L \"" + corePath + "\" \"" + rom + "\"";
if (!File.Exists(emulator))
{
MessageBox.Show("Emulator is required to continue.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
Process.Start(emulator, commandline);
}
}
评论
File.Exists
Process.Start
File.Exists