我相信到目前为止我一直在采取正确的方法,但我想在我的电脑上有个按钮来启动视频游戏。
到目前为止,我有一个链接到进程的按钮:
void button2_Click(object sender, EventArgs e)
{
process1.Start();
}
this.process1.EnableRaisingEvents = true;
this.process1.StartInfo.Domain = "";
this.process1.StartInfo.FileName = "MBO\\marbleblast.exe";
this.process1.StartInfo.LoadUserProfile = false;
this.process1.StartInfo.Password = null;
this.process1.StartInfo.StandardErrorEncoding = null;
this.process1.StartInfo.StandardOutputEncoding = null;
this.process1.StartInfo.UserName = "";
this.process1.SynchronizingObject = this;
this.process1.Exited += new System.EventHandler(this.Process1Exited);
因此,无论我将 EXE(我正在编码的那个)放在哪里,它都会在相对于其位置的子文件夹 MBO 下启动“marbleblast.exe”。
它似乎正在工作并试图启动游戏,但是,它说它无法加载那里的文件。我在没有启动器的情况下测试了游戏,它工作正常。我相信它正在尝试运行 EXE,但不让它使用其文件夹中的其他文件。
如果需要,我会提供更多详细信息。
怎样才能让游戏正常运行?