C# starting Opera process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kappolo
    New Member
    • Dec 2008
    • 3

    C# starting Opera process

    I want to start in C# a process of Opera web browser with a given URL.
    I'm using Windows Mobile 5 and Opera 9.5 Beta
    Ive tried the following code (working of Internet Explorer)
    Code:
    System.Diagnostics.Process proc = new System.Diagnostics.Process();
    proc.StartInfo.FileName = "iexplore";
    proc.StartInfo.Arguments = "http://www.google.com";
    proc.Start();
    I've tried to change "iexplore" in "opera" or "opera.exe" but no success at all.
    Can you please give me a hand?
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Code:
    Process.Start("firefox.exe", "http://www.google.com");
    //or specify path
    //Process.Start(@"C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.google.com");
    
    //OR 
    ProcessStartInfo ind = new ProcessStartInfo("firefox.exe", "http://www.google.com");
    //ProcessStartInfo ind = new ProcessStartInfo(@"C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.google.com");
      Process.Start(ind);

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      The method you are using is correct, but the file names your are using seem to be wrong.

      You're going to have to find the path and name of the executable file and use the full path and name.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by insertAlias
        The method you are using is correct, but the file names your are using seem to be wrong.

        You're going to have to find the path and name of the executable file and use the full path and name.
        By default, the path to the Opera browser is:

        C:\Program Files\Opera\ope ra.exe

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Originally posted by Frinavale
          By default, the path to the Opera browser is:

          C:\Program Files\Opera\ope ra.exe
          So then on a mobile device it would probably be
          \Program Files\Opera\ope ra.exe

          Comment

          • Curtis Rutland
            Recognized Expert Specialist
            • Apr 2008
            • 3264

            #6
            Moved to Mobile Development.

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              Originally posted by Plater
              So then on a mobile device it would probably be
              \Program Files\Opera\ope ra.exe
              Aha! Good catch Plater :)

              Comment

              • markmcgookin
                Recognized Expert Contributor
                • Dec 2006
                • 648

                #8
                I wondered where this post came from, just realised you moved it. Did the above solution of kicking off the \Program Files\Opera\Ope ra.exe work?

                Comment

                Working...