i am using asp.net with VB.net
-
I used the following code to get the Ip address Dim compname As String Dim i As Integer Dim ip1 As String() compname = System.Net.Dns.GetHostName() Dim ipentry As New IPHostEntry ipentry = Dns.GetHostEntry(compname) Dim ip As IPAddress() ip = ipentry.AddressList For i = 0 To ip.Length - 1 MsgBox(ip(i).ToString()) Next But when i host page to server it display server ip address.I want the Client ip address.If anyone know the code pls tell me
-
I used the following code to get the Ip address Dim compname As String Dim i As Integer Dim ip1 As String() compname = System.Net.Dns.GetHostName() Dim ipentry As New IPHostEntry ipentry = Dns.GetHostEntry(compname) Dim ip As IPAddress() ip = ipentry.AddressList For i = 0 To ip.Length - 1 MsgBox(ip(i).ToString()) Next But when i host page to server it display server ip address.I want the Client ip address.If anyone know the code pls tell me
Deepthy.P.M wrote:
Dim compname As String Dim i As Integer Dim ip1 As String() compname = System.Net.Dns.GetHostName() Dim ipentry As New IPHostEntry ipentry = Dns.GetHostEntry(compname) Dim ip As IPAddress() ip = ipentry.AddressList For i = 0 To ip.Length - 1 MsgBox(ip(i).ToString()) Next
Hi, this code is server side code so it wont give you IP of client. try this link[^] May be it can help you.
Thanks, Sun Rays To get something you must have to try once. My Articles
-
I used the following code to get the Ip address Dim compname As String Dim i As Integer Dim ip1 As String() compname = System.Net.Dns.GetHostName() Dim ipentry As New IPHostEntry ipentry = Dns.GetHostEntry(compname) Dim ip As IPAddress() ip = ipentry.AddressList For i = 0 To ip.Length - 1 MsgBox(ip(i).ToString()) Next But when i host page to server it display server ip address.I want the Client ip address.If anyone know the code pls tell me
-
Deepthy.P.M wrote:
I want the Client ip address
Request.UserHostAddress
- Gets the IP Address of the Remote Client.- Regards -
J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
I think u cant understand my probem. I wrote a code but whan i hosted in server it display server dynamic ip adddress.I need client ip address after hosting to web server.If u know the code pls