Get Ip Address and put it in TextBox1??
-
-
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. :)
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
-
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
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
-
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
... 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
-
... 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
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. :)