IP2Region.Net 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package IP2Region.Net --version 1.0.4
NuGet\Install-Package IP2Region.Net -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IP2Region.Net" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IP2Region.Net --version 1.0.4
#r "nuget: IP2Region.Net, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IP2Region.Net as a Cake Addin
#addin nuget:?package=IP2Region.Net&version=1.0.4

// Install IP2Region.Net as a Cake Tool
#tool nuget:?package=IP2Region.Net&version=1.0.4

IP2Region.Net

IP2Region c# xdb client

Installation

Install the package with NuGet

Install-Package IP2Region.Net

Usage

using IP2Region.Net.XDB;

//use default db and cache whole xdb file
Searcher searcher = new Searcher();
searcher.Search("ipaddress value");

/*
 * custom cache policy and xdb file path
 * CachePolicy.Content default cache policy , cache whole xdb file , thread safe
 * CachePolicy.VectorIndex cache vector index , reduce the number of IO operations , not thread safe!
 * CachePolicy.File no cache , not thread safe!
 */
Searcher searcher = new Searcher(CachePolicy.File, "your xdb file path");

ASP.NET Core Usage

services.AddSingleton<ISearcher,Searcher>();

Performance


BenchmarkDotNet=v0.13.2, OS=Windows 11 (10.0.22000.856/21H2)
AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx, 1 CPU, 8 logical and 4 physical cores
.NET SDK=6.0.400
  [Host]     : .NET 6.0.8 (6.0.822.36306), X64 RyuJIT AVX2
  DefaultJob : .NET 6.0.8 (6.0.822.36306), X64 RyuJIT AVX2


Method Mean Error StdDev
CachePolicy_Content 224.6 ns 4.44 ns 7.41 ns
CachePolicy_VectorIndex 11,648.4 ns 231.98 ns 457.91 ns

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

Apache License 2.0

Product 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 was computed.  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 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on IP2Region.Net:

Package Downloads
DH.Services

DH框架服务库

TIA.Core.WebApiBase

TIA.Core.WebApiBase

IGeekFan.FreeKit.Infrastructure

基础包功能模块

CDynamic.Spider

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on IP2Region.Net:

Repository Stars
xianhc/apevolo-api
基于 .Net 8 、SqlSugar、Vue、RBAC、前后端分离的开箱即用的企业级中后台管理系统
Version Downloads Last updated
2.0.2 10,129 10/2/2023
2.0.1 1,321 7/30/2023
2.0.0 1,242 7/26/2023
1.0.10 12,194 9/7/2022
1.0.6 395 9/7/2022
1.0.5 432 9/7/2022
1.0.4 417 9/7/2022
1.0.3 408 9/7/2022
1.0.2 375 9/6/2022
1.0.1 375 9/6/2022
1.0.0 371 9/6/2022