ip2region_private/maker/csharp/IP2RegionMaker
Alice39s 1ebdffed66
chore(license): use local README.md copies for C# packages
- Copy README.md into IP2Region.Net and IP2RegionMaker directories
- Update csproj to pack local README.md instead of parent-relative path
- Keep LICENSE.md packing unchanged
2026-06-30 00:44:23 +09:00
..
Properties/PublishProfiles feat:csharp 2.0 xdb maker 2022-08-08 21:52:16 +08:00
XDB test:concurrent query ip 2023-07-26 21:30:34 +08:00
IP2RegionMaker.csproj chore(license): use local README.md copies for C# packages 2026-06-30 00:44:23 +09:00
LICENSE.md fix(license): align C# binding and maker license metadata 2026-06-29 23:39:13 +09:00
Program.cs feat:csharp 2.0 xdb maker 2022-08-08 21:52:16 +08:00
README.md chore(license): use local README.md copies for C# packages 2026-06-30 00:44:23 +09:00

README.md

🌐 中文简体 | English

ip2region xdb csharp generation implementation

Compilation and Installation

Compilation environment: dotnet6.0

# cd to maker/csharp/IP2RegionMaker directory
dotnet publish -o ./bin

Then you will get a packaged file named IP2RegionMaker.dll in the bin directory of the current folder.

xdb Data Generation

Generate the xdb binary file via dotnet IP2RegionMaker.dll:

➜  csharp git:(master) ✗ dotnet IP2RegionMaker.dll
ip2region xdb maker
dotnet IP2RegionMaker.dll [command options]
--src string    source ip text file path
--dst string    destination binary xdb file path

For example, using the default data/ipv4_source.txt source data to generate an ip2region_v4.xdb binary file in the current directory:

➜  csharp git:(master) ✗ dotnet ./IP2RegionMaker/bin/IP2RegionMaker.dll --src=../../data/ipv4_source.txt --dst=./ip2region_v4.xdb
# You will see a lot of output; eventually, you will see the following output indicating the run was successful
...
...
...
write done, dataBlocks: 13804, indexBlocks: (683591, 720221), indexPtr: (982904, 11065984)
Done, elapsed:2.1966620833333335m

Data Query / bench Test

All bindings come with query and bench test programs as well as usage documentation. You can use the searcher of your familiar language for query testing or bench testing to confirm the correctness and integrity of the data.