IP2Region.Net
3.0.2
dotnet add package IP2Region.Net --version 3.0.2
NuGet\Install-Package IP2Region.Net -Version 3.0.2
<PackageReference Include="IP2Region.Net" Version="3.0.2" />
<PackageVersion Include="IP2Region.Net" Version="3.0.2" />
<PackageReference Include="IP2Region.Net" />
paket add IP2Region.Net --version 3.0.2
#r "nuget: IP2Region.Net, 3.0.2"
#:package IP2Region.Net@3.0.2
#addin nuget:?package=IP2Region.Net&version=3.0.2
#tool nuget:?package=IP2Region.Net&version=3.0.2
IP2Region.Net
.NET client library for IP2Region
Installation
Install the package with NuGet
Install-Package IP2Region.Net
Usage
using IP2Region.Net.Abstractions;
using IP2Region.Net.XDB;
ISearcher searcher = new Searcher(CachePolicy , "your xdb file path");
Cache Policy Description
| Cache Policy | Description | Thread Safe |
|---|---|---|
| CachePolicy.Content | Cache the entire xdb data. |
Yes |
| CachePolicy.VectorIndex | Cache vecotorIndex to speed up queries and reduce system io pressure by reducing one fixed IO operation. |
Yes |
| CachePolicy.File | Completely file-based queries | Yes |
XDB File Description
Generate using maker, or download pre-generated xdb files
ASP.NET Core Usage
services.AddIP2RegionService("your xdb file path", cachePolicy: CachePolicy.Content);
NET6/7
provider.GetRequiredService<ISearcher>()
NET8+ support keyed service
provider.GetRequiredKeyedService<ISearcher>("IP2Region.Net");
TargetFrameworks
netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0;net10.0
Performance
// * Summary *
BenchmarkDotNet v0.15.6, Windows 11 (10.0.26200.7171) 13th Gen Intel Core i7-13700 2.10GHz, 1 CPU, 24 logical and 16 physical cores .NET SDK 10.0.100 [Host] : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v3 DefaultJob : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v3
| Method | Mean | Error | StdDev | Gen0 | Allocated |
|---|---|---|---|---|---|
| ContentIPv4 | 53.70 ns | 0.296 ns | 0.277 ns | 0.0086 | 136 B |
| VectorIPv4 | 4,446.04 ns | 18.673 ns | 15.593 ns | 0.0076 | 232 B |
| FileIPv4 | 6,712.40 ns | 15.718 ns | 13.934 ns | 0.0153 | 264 B |
| ContentIPv6 | 145.53 ns | 0.331 ns | 0.277 ns | 0.0126 | 200 B |
| VectorIPv6 | 7,058.39 ns | 125.505 ns | 117.398 ns | 0.0381 | 712 B |
| FileIPv6 | 10,657.97 ns | 53.907 ns | 50.425 ns | 0.0458 | 744 B |
// * Hints * Outliers Benchmarks.VectorIPv4: Default → 2 outliers were removed (4.55 us, 4.58 us) Benchmarks.FileIPv4: Default → 1 outlier was removed (6.79 us) Benchmarks.ContentIPv6: Default → 2 outliers were removed (148.08 ns, 152.27 ns)
// * Legends * Mean : Arithmetic mean of all measurements Error : Half of 99.9% confidence interval StdDev : Standard deviation of all measurements Gen0 : GC Generation 0 collects per 1000 operations Allocated : Allocated memory per single operation (managed only, inclusive, 1KB = 1024B) 1 ns : 1 Nanosecond (0.000000001 sec)
// * Diagnostic Output - MemoryDiagnoser *
// ***** BenchmarkRunner: End ***** Run time: 00:02:06 (126.09 sec), executed benchmarks: 6
Global total time: 00:02:13 (133.47 sec), executed benchmarks: 6 // * Artifacts cleanup * Artifacts cleanup is finished
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
-
.NETStandard 2.1
-
net10.0
-
net6.0
-
net7.0
-
net8.0
-
net9.0
NuGet packages (26)
Showing the top 5 NuGet packages that depend on IP2Region.Net:
| Package | Downloads |
|---|---|
|
DH.Services
DH框架服务库 |
|
|
Abc.Utils
Abc.Utils 至少NET8.0,Furion 最低NET8.0 |
|
|
XiHan.Framework.Web.Core
曦寒框架 Web 核心库 |
|
|
BootstrapBlazor.IP2Region
Bootstrap UI components extensions of IP2Region.NET |
|
|
Neto
Neto |
GitHub repositories (11)
Showing the top 11 popular GitHub repositories that depend on IP2Region.Net:
| Repository | Stars |
|---|---|
|
izhaorui/Zr.Admin.NET
🎉 ZR.Admin.NET —— 基于 .NET 8 + SqlSugar + Vue3 的前后端分离通用权限管理框架(RBAC),跨平台、开箱即用。内置 SaaS 多租户(一租户一库)、可视化工作流引擎、一键代码生成、Quartz.NET 任务调度、Redis 缓存、SignalR 实时通知、接口限流、全局异常处理、数据权限过滤与动态国际化,并集成 AI 助手与 AI 治理能力。代码简洁易懂、易扩展。
|
|
|
xianhc/ape-volo-admin
🚀 Ape-Volo-Admin — 基于 .NET 10、Vue 3、TypeScript 与 SqlSugar 的企业级后台开发框架,集成身份认证、RBAC 授权与数据权限,开箱即用,让开发更专注于业务。
|
|
|
colinin/abp-next-admin
这是基于vue-vben-admin 模板适用于abp vNext的前端管理项目
|
|
|
bing-framework/Bing.NetCore
Bing是基于 .net core 3.1 的框架,旨在提升团队的开发输出能力,由常用公共操作类(工具类、帮助类)、分层架构基类,第三方组件封装,第三方业务接口封装等组成。
|
|
|
zy-zmc/tianming-novel-ai-writer
天命 — AI小说创作/写作系统 | 15维事实快照 · 12类变更声明 · 6道生成门禁 | 写到3000章依然连贯,不依赖上下文,不靠模型记忆,靠每章状态回写
|
|
|
Deali-Axy/StarBlog
☀StarBlog 是一个基于 .NET Core 开发的现代博客系统,支持 Markdown 文章导入,遵循 RESTful 接口规范。前端基于 Vue + ElementUI 开发,可作为 .NET Core 入门学习项目,同时配套了一系列开发笔记,记录了从零开始构建这个博客系统的全过程,可以帮助学习理解 .Net Core 项目的开发流程。
|
|
|
dymproject/purest-admin
Purest Admin 是一套真正意义上前后端分离、深度适配企业RBAC权限体系的通用后台管理系统。依托现代化 .NET 10 技术栈、Vue3 生态前端、强大的工作流引擎,力求降低业务框架搭建门槛,实现一站式、敏捷、高可扩展的企业级后台管理平台。
|
|
|
DotNet-MoYu/SimpleAdmin
💥一个小而美的通用业务型后台管理系统。采用前后端分离的设计模式,基于RBAC+多机构的权限管理模式,实现接口级别的数据权限控制。集成国密加解密插件,注释详细,文档齐全,让你的开发少走弯路。
|
|
|
Redns/North
一个易于搭建的图床服务
|
|
|
aehyok/.NET8.0
net8.0 efcore mysql redis rabbitmq 微服务
|
|
|
XiHanFun/XiHan.Framework
A fast, lightweight, efficient, and thoughtfully crafted .NET microkernel development framework. It serves as the backend foundation for the XiHanFun open-source ecosystem.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.2 | 27,822 | 3/3/2026 |
| 3.0.1 | 2,270 | 2/12/2026 |
| 3.0.0 | 4,089 | 11/27/2025 |
| 2.0.2 | 164,183 | 10/2/2023 |
| 2.0.1 | 3,389 | 7/30/2023 |
| 2.0.0 | 1,889 | 7/26/2023 |
| 1.0.10 | 21,200 | 9/7/2022 |
| 1.0.6 | 690 | 9/7/2022 |
| 1.0.5 | 709 | 9/7/2022 |
| 1.0.4 | 765 | 9/7/2022 |
| 1.0.3 | 698 | 9/7/2022 |
| 1.0.2 | 633 | 9/6/2022 |
| 1.0.1 | 628 | 9/6/2022 |
| 1.0.0 | 713 | 9/6/2022 |
Please refer to CHANGELOG.md for details