???????????д???????IP??????????????????????????????ip?????????????????????????????????GBK????????????????????????????UTF-8?????????????????????????????????д??????ip????
<%
'?????????IP
public Function getip()
Dim strIPAddr
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? "unknown") > 0 Then
strIPAddr = Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? "??") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? 1?? InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? "??")-1)
actforip=Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? ";") > 0 Then
strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? 1?? InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR")?? ";")-1)
actforip=Request.ServerVariables("REMOTE_ADDR")
Else
strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
actforip=Request.ServerVariables("REMOTE_ADDR")
End If
getip = Trim(Mid(strIPAddr?? 1?? 30))
End Function
' ============================================
' ????IP???????
' ============================================
Function Look_Ip(IP)
Dim Wry?? IPType?? QQWryVersion?? IpCounter
' ?????????
Set Wry = New TQQWry
' ??????????????????????
' ????????? QQWry(IP) ????????ж??IP?????????????????????????????????????????Щ????
' ?????????????????????????????????????????
IPType = Wry.QQWry(IP)
' Country?????????
' LocalStr????м???????????
Look_Ip = Wry.Country & " " & Wry.LocalStr
End Function
' ============================================
' ????QQWry???
' ============================================
Function WryInfo()
Dim Wry?? IPType?? QQWry(1)
' ?????????
Set Wry = New TQQWry
IPType = Wry.QQWry("255.255.255.255")
' ????????汾???
QQWry(0) = Wry.Country & " " & Wry.LocalStr
' ????????IP??????
QQWry(1) = Wry.RecordCount + 1
WryInfo = QQWry
End Function
' ============================================
' IP?????λ??????
' ============================================
Class TQQWry
' ============================================
' ????????
' ============================================
Dim Country?? LocalStr?? Buf?? OffSet
Private StartIP?? EndIP?? CountryFlag
Public QQWryFile
Public FirstStartIP?? LastStartIP?? RecordCount
Private Stream?? EndIPOff
' ============================================
' ?????????
' ============================================