zoukankan      html  css  js  c++  java
  • IPQuery 库使用说明

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html
    内部邀请码:C8E245J (不写邀请码,没有现金送)
    国内私募机构九鼎控股打造,九鼎投资是在全国股份转让系统挂牌的公众公司,股票代码为430719,为“中国PE第一股”,市值超1000亿元。 
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------

    因之前的文章《IP地址库解析》上传文件错误,导致许多网友运行时出现错误,在此向各位道歉了。

    在此奉上使用说明:

    ============================================
    使用说明
    ============================================
    1、下载 qqwry.dat
    http://www.onlinedown.net/soft/19051.htm

    2、解压文件,放到网站的bin目录下。
    形成如下结构:



    3、浏览首页: Default.aspx 即可

    ============================================
    IPQUERY.DLL 使用说明
    ============================================
    1、在网站根目录下初始化IP数据库文件

    protected void Application_Start(object sender, EventArgs e)
    {
    	// 这里初始化查询引擎,设置 qqwry.dat 的网站根目录
    	string ipData = Server.MapPath(@"~\bin\qqwry.dat");
    	IPQuery.Facade.SingleQuery.Instance.SetDataFilePath(ipData);
    }
    

      

    2、查询ip地址

    /// <summary>
    /// 点击查询按钮
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnQuery_Click(object sender, EventArgs e)
    {
    	string ip = this.TextBox1.Text;
    	if (string.IsNullOrEmpty(ip))
    	{
    		this.Page.Response.Write("大哥,好歹也给个地址啊!");
    		return;
    	}
    	this.Page.Response.Write(this.Output(SingleQuery.Instance.Find(ip)));
    }
    	
    /// <summary>
    /// 输出IP地址记录
    /// </summary>
    /// <param name="ipRecord"></param>
    /// <returns></returns>
    private string Output(IPAddressRecord ipRecord)
    {
    	if (null != ipRecord)
    	{
    		return string.Format("{0} - {1} {2} {3}", AddressConvert.UInt32ToIpV4String(ipRecord.IPStart), AddressConvert.UInt32ToIpV4String(ipRecord.IPEnd), ipRecord.Country, ipRecord.Area);
    	}
    	return string.Empty;
    }
    

      

    ============================================
    ××××××××××××××××××××××××××××××××××××××××××××
    作者:孤剑
    http://www.cnblogs.com/alonesword/
    http://blog.csdn.net/alonesword/

  • 相关阅读:
    Spring Mvc和Mybatis的多数据库访问配置过程
    Git下解决冲突
    安装Git
    数据库优化
    Ubuntu版 微信
    ssh框架简介
    写代码的习惯
    CentOS 7 安装 docker 并搭建私有仓库
    IPv4地址分类及特征
    Xcode 7.0 Could not find developer disk image
  • 原文地址:https://www.cnblogs.com/AloneSword/p/2555380.html
Copyright © 2011-2022 走看看