Keep in touch

you can keep in touch with my all blogs and sites by install this Toolbar...
http://rworldtoolbar.ourtoolbar.com/

Saturday, March 6, 2010

Get IP Address of Visitor's Machine

Dim ipaddress As String
ipaddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If ipaddress = "" Or ipaddress Is Nothing Then
ipaddress = Request.ServerVariables("REMOTE_ADDR")
End If

When users use any proxies or routers the REMOTE_ADDR returns the IP Address of router or proxy and not the client user’s machine. So first we need to check HTTP_X_FORWARDED_FOR.