ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")

oppure

ip=Request.ServerVariables("REMOTE_ADDR")