Connecting Tech Pros Worldwide Help | Site Map

C# starting Opera process

Newbie
 
Join Date: Dec 2008
Posts: 3
#1: Dec 4 '08
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)
Expand|Select|Wrap|Line Numbers
  1. System.Diagnostics.Process proc = new System.Diagnostics.Process();
  2. proc.StartInfo.FileName = "iexplore";
  3. proc.StartInfo.Arguments = "http://www.google.com";
  4. 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 PRR is offline
Moderator
 
Join Date: Dec 2007
Location: India
Posts: 699
#2: Dec 4 '08

re: C# starting Opera process


Expand|Select|Wrap|Line Numbers
  1. Process.Start("firefox.exe", "http://www.google.com");
  2. //or specify path
  3. //Process.Start(@"C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.google.com");
  4.  
  5. //OR 
  6. ProcessStartInfo ind = new ProcessStartInfo("firefox.exe", "http://www.google.com");
  7. //ProcessStartInfo ind = new ProcessStartInfo(@"C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.google.com");
  8.   Process.Start(ind);
  9.  
  10.  
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,603
#3: Dec 4 '08

re: C# starting Opera process


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.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,066
#4: Dec 4 '08

re: C# starting Opera process


Quote:

Originally Posted by insertAlias View Post

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\opera.exe
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#5: Dec 4 '08

re: C# starting Opera process


Quote:

Originally Posted by Frinavale View Post

By default, the path to the Opera browser is:

C:\Program Files\Opera\opera.exe

So then on a mobile device it would probably be
\Program Files\Opera\opera.exe
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,603
#6: Dec 4 '08

re: C# starting Opera process


Moved to Mobile Development.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,066
#7: Dec 4 '08

re: C# starting Opera process


Quote:

Originally Posted by Plater View Post

So then on a mobile device it would probably be
\Program Files\Opera\opera.exe

Aha! Good catch Plater :)
markmcgookin's Avatar
Moderator
 
Join Date: Dec 2006
Location: Northern Ireland / England
Posts: 546
#8: Dec 4 '08

re: C# starting Opera process


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

Tags
csharp, opera, process, url, windows mobile