GithubHelp home page GithubHelp logo

ipquery_qqwry's Introduction

IpQuery_QQWry

纯真IP数据库查询(C++、C#)

数据库仓库:

C++

代码里面有用到部分C++11语法,如果需要在较老编译环境下使用,那么需要做简单修改。另外读到的字符串编码是GB2312,如果后续需要UTF8之类的编码,需要自己手工处理。

使用方式:

IpQuery_QQWry _ip_query ("qqwry.dat");
auto [_info0, _info1, _desp] = _ip_query.find_info ("8.8.8.8");
std::cout << "info0[" << _info0 << "]\n";
std::cout << "info1[" << _info1 << "]\n";
std::cout << "_desp[" << _desp << "]\n";

C#

这个数据库使用GB2312编码方式进行编码。默认 .Net Core 不支持此编码,所以 .Net Framework 可以直接使用;.Net Core 需要按如下步骤:

  1. 工具 -> NuGet 包管理器 -> 管理解决方案的 NuGet 程序包;
  2. 浏览 -> System.Text.Encoding.CodePages -> 安装
  3. 加入初始化代码:Encoding.RegisterProvider (CodePagesEncodingProvider.Instance);

使用方式:

IpQuery_QQWry _ip_query = new IpQuery_QQWry ("qqwry.dat");
var (_info0, _info1, _desp) = _ip_query.find_info ("8.8.8.8");
Console.WriteLine ($"info0[{_info0}]");
Console.WriteLine ($"info1[{_info1}]");
Console.WriteLine ($"desp[{_desp}]");

相关链接

开源协议

MIT

ipquery_qqwry's People

Contributors

fawdlstty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.