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. opening a URL

opening a URL

Scheduled Pinned Locked Moved C#
csharpcom
5 Posts 4 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.
  • D Offline
    D Offline
    dwark106
    wrote on last edited by
    #1

    How make a program in C# which connect any URL(like www.google.com)and when user click on button(whatever enter on the textbox like(www.google.com))it open the page.

    A Y B 3 Replies Last reply
    0
    • D dwark106

      How make a program in C# which connect any URL(like www.google.com)and when user click on button(whatever enter on the textbox like(www.google.com))it open the page.

      A Offline
      A Offline
      ACorbs
      wrote on last edited by
      #2

      System.Diagnostics.ProcessStartInfo pi =new System.Diagnostics.ProcessStartInfo(this.website.Text); System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = pi; p.Start(); This works as long as it starts with www or http://. However, this is open to exploitation, so filtering may be in order. Also, website is a textbox.

      1 Reply Last reply
      0
      • D dwark106

        How make a program in C# which connect any URL(like www.google.com)and when user click on button(whatever enter on the textbox like(www.google.com))it open the page.

        Y Offline
        Y Offline
        Yulianto
        wrote on last edited by
        #3

        Use ShellExecute to open the page, You need to pass which application to open the page and the url


        Work hard and a bit of luck is the key to success.

        You don`t need to be genius, to be rich.

        1 Reply Last reply
        0
        • D dwark106

          How make a program in C# which connect any URL(like www.google.com)and when user click on button(whatever enter on the textbox like(www.google.com))it open the page.

          B Offline
          B Offline
          BH Serpa
          wrote on last edited by
          #4

          put this code in button click or under menu click System.Diagnostics.Process.Start("http://www.google.ba");

          D 1 Reply Last reply
          0
          • B BH Serpa

            put this code in button click or under menu click System.Diagnostics.Process.Start("http://www.google.ba");

            D Offline
            D Offline
            dwark106
            wrote on last edited by
            #5

            Thanks to everyone. I also did in another way.

            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