Finding Ip Address and storing

Posted by Sthsyed under ASP.NET on 10/18/2015 | Points: 10 | Views : 1057 | Status : [Member] | Replies : 2
I have a Intranet application and i need to store ip Address of the computer using it after logging.

I try the below code but not working.

Dim strIpAddress As String = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If strIpAddress Is Nothing Then
Label2.Text = Request.ServerVariables("REMOTE_ADDR")
End If

Can anybody help in regarding it.

Thanks




Responses

Posted by: Sheonarayan on: 10/19/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
What is the problem you are facing in above code snippet, instead of setting the value into Label2, store it into strIpAddress variable and store it.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Sthsyed, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sthsyed on: 10/19/2015 [Member] Starter | Points: 25

Up
0
Down
I solved the issue thanks

Sthsyed, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response