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. Visual Basic
  4. Get Ip Address and put it in TextBox1??

Get Ip Address and put it in TextBox1??

Scheduled Pinned Locked Moved Visual Basic
questionhelp
5 Posts 2 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
    Darshon
    wrote on last edited by
    #1

    Ok I've looked all over the place here and on other forums and surpprizingly I can't find this anywhere. How do I get the IP Address my browser is at right now and display it in my addressbar (a.k.a TextBox1)? Thanx for any help you can give me. :)

    J 1 Reply Last reply
    0
    • D Darshon

      Ok I've looked all over the place here and on other forums and surpprizingly I can't find this anywhere. How do I get the IP Address my browser is at right now and display it in my addressbar (a.k.a TextBox1)? Thanx for any help you can give me. :)

      J Offline
      J Offline
      Jason McBurney
      wrote on last edited by
      #2

      There are two answers to this depending on what you are really looking for: First, the really ipaddress can be obtained from the DNS object in the framework. you textbox assignment would look something like: text1.value = system.Net.Dns.GetHostByAddress.tostring() However, if you are doing asp.net, you may really desire what the url adress bar "server" name is for example: http://www.codeproject.com/script/comments/user\_reply.asp the server name is "www.codeproject.com" which can be applied to a textbox like so: text1.value = page.Request.ServerVariables ("SERVER_NAME") Hope that helped. do you need to investigate an online backup[^] company

      D 1 Reply Last reply
      0
      • J Jason McBurney

        There are two answers to this depending on what you are really looking for: First, the really ipaddress can be obtained from the DNS object in the framework. you textbox assignment would look something like: text1.value = system.Net.Dns.GetHostByAddress.tostring() However, if you are doing asp.net, you may really desire what the url adress bar "server" name is for example: http://www.codeproject.com/script/comments/user\_reply.asp the server name is "www.codeproject.com" which can be applied to a textbox like so: text1.value = page.Request.ServerVariables ("SERVER_NAME") Hope that helped. do you need to investigate an online backup[^] company

        D Offline
        D Offline
        Darshon
        wrote on last edited by
        #3

        Hi Jason, Yes what I'm looking for is to display the full http:// address that one sees in the browser address bar. I'm creating a very simple web browser and the address bar (Textbox) works fine but when I click on a page link to another link I would like to display the address in the same address bar. Will your second example work for this? And is there more to the code to do this then just putting your example to the textbox I have? -- modified at 1:35 Saturday 4th February, 2006

        J 1 Reply Last reply
        0
        • D Darshon

          Hi Jason, Yes what I'm looking for is to display the full http:// address that one sees in the browser address bar. I'm creating a very simple web browser and the address bar (Textbox) works fine but when I click on a page link to another link I would like to display the address in the same address bar. Will your second example work for this? And is there more to the code to do this then just putting your example to the textbox I have? -- modified at 1:35 Saturday 4th February, 2006

          J Offline
          J Offline
          Jason McBurney
          wrote on last edited by
          #4

          ... The second example will only work if you are working in Asp.net (thus providing a webpage to a client through a browser) as you are creating a "simple web browser" I am sure that the second concept will not function like you want. When the user of your application clicks on a link within the document that you are presenting to them, why not just copy that link to your addressbar_textbox.value? do you need to investigate an online backup[^] company

          D 1 Reply Last reply
          0
          • J Jason McBurney

            ... The second example will only work if you are working in Asp.net (thus providing a webpage to a client through a browser) as you are creating a "simple web browser" I am sure that the second concept will not function like you want. When the user of your application clicks on a link within the document that you are presenting to them, why not just copy that link to your addressbar_textbox.value? do you need to investigate an online backup[^] company

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

            Hi Jason, After looking around I was able to find exactly what I was looking for. This is what I've got now that works really well. 'Make the Url_Address bar display the url your at. Private Sub AxWebBrowser_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) Handles AxWebBrowser.NavigateComplete2 URL_Address.Text = AxWebBrowser.LocationURL End Sub Thanks for your help. :)

            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