(C# PROGRAMMING) HELP WITH THIS CODE!

Discussion in 'Computer Programming, Emulation, and Game Modding' started by XabiPlayerPRO, Mar 12, 2017.

  1. XabiPlayerPRO
    OP

    XabiPlayerPRO Member

    Newcomer
    48
    22
    Jan 3, 2017
    I´m trying to open a file with an specific program from my program. I mean, I have a non-formatted file and I want to open it with WinRAR (it´s an example), but it only lets me to open the file and doesn´t let me to specify the program (in this case, WinRAR). Anybody can help me?
     
  2. Sammi Husky

    Sammi Husky GBAtemp Fan

    Member
    311
    284
    Jul 6, 2014
    United States
    As far as i'm aware, the easiest way would be to open the new process and make it open the file you want by passing the args to the new process as arguments. That is if the target app has functionality to open from CLI arguments. In which case you can specify the parameters when starting the process from within your app.

    The args of course would be the same as if you were running the target app from command prompt

    Something like
    Code:
    Process p = new Process();
    p.StartInfo.FileName = App_To_Start;
    p.StartInfo.Arguments = Your_Args_Here;
    p.Start();