Home > Mobile >  What's wrong with my Click Code Event button in visual studio to open a specific file.exe?
What's wrong with my Click Code Event button in visual studio to open a specific file.exe?

Time:12-21

private void button1_Click_1(object sender, EventArgs e)
    {
        Process jcam = new Process();
        jcam.StartInfo.FileName = @"C:\Program Files\JasminCam Five\App\JCam-main.exe";
        jcam.Start();
    }

This is my code for the Click Event, but it get s the next error : Not Found The Configuration File

CodePudding user response:

There are two possible reasons for this error:

  1. Your ProgrameFile is an encrypted folder, and you need to change a folder to try this operation. Also you need to check your file paths.

  2. UseShellExecute property is true. For example:

     Process jcam = new Process();
     jcam.StartInfo.FileName = "notepad.exe";
     ProcessStartInfo pr= jcam.StartInfo;
     pr.UseShellExecute= true;
     jcam.Start();
    
  • Related