<%
Function Getip()
Dim Ip
If Request.ServerVariables("HTTP_X_ForWARDED_For")="" Then
Ip=Request.ServerVariables("REMOTE_ADDR")
Else
Ip=Request.ServerVariables("HTTP_X_ForWARDED_For")
End If
Getip=Ip
End Function
response.write Getip '输出ip地址
%>
建立上面的函数,或者放到一个公共文件下,通过调用Getip即可取得用户的ip地址。