ShellExecute ?
-
Does anyone know how I can launch a URL in C# ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
-
Does anyone know how I can launch a URL in C# ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
System.Diagnostics.Process myproc = new System.Diagnostics.Process(); myproc.Start("IExplore.exe", "http://www.microsoft.com"); Why in the world Process is part of the Diagnostics namespace is beyond me though :-P James Simplicity Rules!
-
System.Diagnostics.Process myproc = new System.Diagnostics.Process(); myproc.Start("IExplore.exe", "http://www.microsoft.com"); Why in the world Process is part of the Diagnostics namespace is beyond me though :-P James Simplicity Rules!
bah, I just realized this only works for IE and not the default browser :( However, what happens if you put the URL inplace of IExplore.exe? James *James is currently munching on some pizza so he can't be bothered to type a test program in with one hand :)* Simplicity Rules!
-
bah, I just realized this only works for IE and not the default browser :( However, what happens if you put the URL inplace of IExplore.exe? James *James is currently munching on some pizza so he can't be bothered to type a test program in with one hand :)* Simplicity Rules!
Just setting the .StartInfo.FileName property to the URL and the StartInfo.Verb to "Open" should do the trick... i.e. System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = "http://www.codeproject.com/"; process.StartInfo.Verb = "Open"; process.Start(); Regards
-
Just setting the .StartInfo.FileName property to the URL and the StartInfo.Verb to "Open" should do the trick... i.e. System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = "http://www.codeproject.com/"; process.StartInfo.Verb = "Open"; process.Start(); Regards
I found that start was a static method, I had to do it all in one line. Is this not the case ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
-
I found that start was a static method, I had to do it all in one line. Is this not the case ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
The Start method I use in the given code (no parameters) is not static. The others are. Regards
-
I found that start was a static method, I had to do it all in one line. Is this not the case ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
Doh, blame the documentation :-P What I wrote was a conversion of a VB sample :-D James Simplicity Rules!
-
Doh, blame the documentation :-P What I wrote was a conversion of a VB sample :-D James Simplicity Rules!
Thanks - between you and Neil I think I have all I need to update the code tonight for the 7 people still using Netscape, although they are all more likely to be using a slashdot screensaver than one from CP :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
-
Thanks - between you and Neil I think I have all I need to update the code tonight for the 7 people still using Netscape, although they are all more likely to be using a slashdot screensaver than one from CP :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile. - Jamie Hale, 17/4/2002
Christian Graus wrote: be using a slashdot screensaver I think they're running SETI :) James Simplicity Rules!