Open IE with a specific link

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2008
Posts: 2,015
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 299
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Postaholic

Open IE with a specific link

 
0
  #1
Nov 30th, 2008
I want to open IE from a forms application. A bit like daniweb does it btw.!
I have the following in a button click eventhandler:
  1. Process MyProcess = new Process();
  2. //string MyPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
  3.  
  4. MyProcess.StartInfo.Domain = "";
  5. MyProcess.StartInfo.FileName = "iexplore.exe"; //MyPath + "\\iexplore.exe";
  6. MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
  7. MyProcess.StartInfo.CreateNoWindow = false;
  8. MyProcess.Start();
This is what I want, but it just opens a IE window.
The next code goes to the website I want, but opens it in a maximised window or it opens in IE if it is already open which is not what I want.
  1. string link = "www.google.com";
  2. System.Diagnostics.Process.Start(link);
I googled,daniwebbed etc. for hours, perhaps with bad search strings, but could not find an answer.
Anybody any suggestion? It must be simple in my opinion, but my mind has one of its off days I think...
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Open IE with a specific link

 
1
  #2
Nov 30th, 2008
Does it have to be IE? If you just run the link as a system call, it will open the default browser.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,015
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 299
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Postaholic

Re: Open IE with a specific link

 
0
  #3
Nov 30th, 2008
Most of the time I Safari. But when I C# I'm under Vista on a Mac. So it's IE, I don't care. My second option does almost what I want. But I want my site to always open in a separate window which is a bit smaller than the applicationwindow that opened it. At least daniweb does it, so why can I? With a little help from my fiends in this case...
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Open IE with a specific link

 
0
  #4
Nov 30th, 2008
I believe if you call iexpore with "-new" and then the url so it goes "iexplore -new http://blah.com" it should work.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,015
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 299
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Postaholic

Re: Open IE with a specific link

 
0
  #5
Dec 1st, 2008
Originally Posted by LizR
Does it have to be IE?
Hmm...Started thinking(doesn't always happen) ... What if I let my button open a new form with a Webbrowsercontrol in it? Yes!!
Thanks LizR!! Problem solved!! This is even better because this way I can open just only one website, just like I wanted.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,015
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 299
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Postaholic

Re: Open IE with a specific link

 
0
  #6
Dec 1st, 2008
I now found out that a simple call like
Process.Start("IExplore.exe", "http://blah.com");
also does the trick I wanted.
Last edited by ddanbe; Dec 1st, 2008 at 1:37 pm. Reason: typo
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Open IE with a specific link

 
0
  #7
Dec 1st, 2008
I assumed you were having problem with a new window, Ie maybe set not to use a new window but reuse of course.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC