elysion_k 2015-08-21 01:26 采纳率: 5%
浏览 1422

纯真数据库dat文件无法实例问题



private IPSeeker() {
        ipCache = new Hashtable();
        loc = new IPLocation();
        buf = new byte[100];
        b4 = new byte[4];
        b3 = new byte[3];
        try {
            ipFile = new RandomAccessFile(IP_FILE, "r");
        } catch (FileNotFoundException e) {
            System.out.println(IPSeeker.class.getResource("QQWry.dat")
                    .toString());
            System.out.println(IP_FILE);
            System.out.println("IP地址信息文件没有找到,IP显示功能将无法使用");
            ipFile = null;

        }
        // 如果打开文件成功,读取文件头信息
        if (ipFile != null) {
            try {
                ipBegin = readLong4(0);
                ipEnd = readLong4(4);
                if (ipBegin == -1 || ipEnd == -1) {
                    ipFile.close();
                    ipFile = null;
                }
            } catch (IOException e) {
                System.out.println("IP地址信息文件格式有错误,IP显示功能将无法使用");
                ipFile = null;
            }
        }
    }

    /**
     * @return 单一实例
     */
    public static IPSeeker getInstance() {
        return instance;
    }


网上找的一个QQ的纯真数据库IP文件, 在我的机器上都行,放别人机器上实例失败没找到qqwry文件,, 文件和class类放一个包里,
求问这么解决 ,

  • 写回答

1条回答 默认 最新

  • oyljerry 2015-08-21 01:52
    关注

    路径对不对,你可以用qqwry的绝对路径等试试。

    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退