Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ShellExecute ?

ShellExecute ?

Scheduled Pinned Locked Moved C#
csharpquestion
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • C Christian Graus

      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

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      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!

      J 1 Reply Last reply
      0
      • J James T Johnson

        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!

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        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!

        N 1 Reply Last reply
        0
        • J James T Johnson

          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!

          N Offline
          N Offline
          Neil Van Note
          wrote on last edited by
          #4

          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

          C 1 Reply Last reply
          0
          • N Neil Van Note

            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

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            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

            N J 2 Replies Last reply
            0
            • C Christian Graus

              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

              N Offline
              N Offline
              Neil Van Note
              wrote on last edited by
              #6

              The Start method I use in the given code (no parameters) is not static. The others are. Regards

              1 Reply Last reply
              0
              • C Christian Graus

                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

                J Offline
                J Offline
                James T Johnson
                wrote on last edited by
                #7

                Doh, blame the documentation :-P What I wrote was a conversion of a VB sample :-D James Simplicity Rules!

                C 1 Reply Last reply
                0
                • J James T Johnson

                  Doh, blame the documentation :-P What I wrote was a conversion of a VB sample :-D James Simplicity Rules!

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  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

                  J 1 Reply Last reply
                  0
                  • C Christian Graus

                    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

                    J Offline
                    J Offline
                    James T Johnson
                    wrote on last edited by
                    #9

                    Christian Graus wrote: be using a slashdot screensaver I think they're running SETI :) James Simplicity Rules!

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups