ASP调用纯真IP库实例分析
发布时间:2023-12-21 12:22:10 所属栏目:Asp教程 来源:DaWei
导读: ASP调用纯真IP库实例做项目的时候遇到了ASP调用纯真IP库的问题,现在说一下解决方法
<%
' ============================================
' 返回IP信息 Disp_IPAddressData(IP,0
<%
' ============================================
' 返回IP信息 Disp_IPAddressData(IP,0
ASP调用纯真IP库实例做项目的时候遇到了ASP调用纯真IP库的问题,现在说一下解决方法 <% ' ============================================ ' 返回IP信息 Disp_IPAddressData(IP,0) ' ============================================ 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 '''''Look_Ip = Wry.Country & "" End Function ' ============================================ ' 返回IP信息 JS调用 ' ============================================ Function Disp_IPAddressData(IP, sType) Dim Wry, IPType Set Wry = New TQQWry IPType = Wry.QQWry(IP) Select Case sType Case 1 Disp_IPAddressData = IP Case 2 Disp_IPAddressData = Wry.Country Case 3 Disp_IPAddressData = Wry.LocalStr 'Case Else Disp_IPAddressData = Wry.Country & "" & Wry.LocalStr Case Else Disp_IPAddressData = Wry.Country End Select End Function ' ============================================ ' 返回QQWry信息 ' ============================================ Function WryInfo() Dim Wry, IPType, QQWry_tem(0), QQWry_tem1(1) ' 设置类对象 Set Wry = New TQQWry IPType = Wry.QQWry("255.255.255.254") ' 读取数据库版本信息 QQWry_tem(0) = Wry.Country & " " & Wry.LocalStr ' 读取数据库IP地址数目 QQWry_tem1(1) = Wry.RecordCount + 1 WryInfo = QQWry_tem(0)& " " & QQWry_tem1(1) End Function (编辑:大连站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |