When running a program using Process.Start, it can't find it's resource files

前端 未结 2 1223
醉话见心
醉话见心 2021-01-20 05:40

i have this code:

private void button1_Click(object sender, EventArgs e)
{
    Process p = new Process();
    p.StartInfo.FileName = \"C:/Users/Valy/Desktop/         


        
2条回答
  •  轮回少年
    2021-01-20 06:18

    I've searched on the internet for a solution at your problem and found this site: http://www.widecodes.com/0HzqUVPWUX/i-am-lauching-an-opengl-program-exe-file-from-visual-basic-but-the-texture-is-missing-what-is-wrong.html

    In C# code it looks something like this:

    string exepath = @"C:\Users\Valy\Desktop\3dcwrelease\3dcw.exe";
    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = exepath;
    psi.WorkingDirectory = Path.GetDirectoryName(exepath);
    Process.Start(psi);
    

提交回复
热议问题