Merge pull request #452 from lionsoul2014/i18n_csharp_maker_readme

add english readme for c# maker
This commit is contained in:
Leon / 狮子的魂 2026-02-26 14:26:15 +08:00 committed by GitHub
commit 1a8d01d967
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 50 additions and 6 deletions

View File

@ -70,7 +70,7 @@ For API introductions, usage documentation, and test programs, please refer to t
| [Golang](maker/golang/README.md) | golang xdb generation program | :white_check_mark: | :white_check_mark: |
| [Java](maker/java/README.md) | java xdb generation program | :white_check_mark: | :white_check_mark: |
| [Python](maker/python/README.md) | python xdb generation program | :white_check_mark: | :x: |
| [Csharp](maker/csharp) | csharp xdb generation program | :white_check_mark: | :x: |
| [Csharp](maker/csharp/README.md) | csharp xdb generation program | :white_check_mark: | :x: |
| [Rust](maker/rust/README.md) | rust xdb generation program | :white_check_mark: | :white_check_mark: |
| [C++](maker/cpp) | C++ xdb generation program | :white_check_mark: | :white_check_mark: |

View File

@ -69,7 +69,7 @@ API 介绍,使用文档和测试程序请参考如下 `maker` 生成程序下
| [Golang](maker/golang/README_zh.md) | golang xdb 生成程序 | :white_check_mark: | :white_check_mark: |
| [Java](maker/java/README_zh.md) | java xdb 生成程序 | :white_check_mark: | :white_check_mark: |
| [Python](maker/python/README_zh.md) | python xdb 生成程序 | :white_check_mark: | :x: |
| [Csharp](maker/csharp) | csharp xdb 生成程序 | :white_check_mark: | :x: |
| [Csharp](maker/csharp/README_zh.md) | csharp xdb 生成程序 | :white_check_mark: | :x: |
| [Rust](maker/rust/README_zh.md) | rust xdb 生成程序 | :white_check_mark: | :white_check_mark: |
| [C++](maker/cpp) | C++ xdb 生成程序 | :white_check_mark: | :white_check_mark: |

42
maker/csharp/README.md Normal file
View File

@ -0,0 +1,42 @@
:globe_with_meridians: [中文简体](README_zh.md) | [English](README.md)
# ip2region xdb csharp generation implementation
# Compilation and Installation
Compilation environment: [dotnet6.0](https://dotnet.microsoft.com/zh-cn/download/dotnet/6.0)
```bash
# 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`:
```bash
➜ 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:
```bash
➜ 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](../../binding/) 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.

View File

@ -1,3 +1,5 @@
:globe_with_meridians: [中文简体](README_zh.md) | [English](README.md)
# ip2region xdb csharp 生成实现
## 编译安装
@ -11,7 +13,7 @@ dotnet publish -o ./bin
# 数据生成
通过 `dotnet IP2RegionMaker.dll` 来生成 ip2region.xdb 二进制文件:
通过 `dotnet IP2RegionMaker.dll` 来生成 xdb 二进制文件:
```bash
➜ csharp git:(master) ✗ dotnet IP2RegionMaker.dll
ip2region xdb maker
@ -20,9 +22,9 @@ dotnet IP2RegionMaker.dll [command options]
--dst string destination binary xdb file path
```
例如,通过默认的 data/ip.merge.txt 原数据,在当前目录生成一个 ip2region.xdb 二进制文件:
例如,通过默认的 data/ipv4_source.txt 原数据,在当前目录生成一个 ip2region_v4.xdb 二进制文件:
```bash
➜ csharp git:(master) ✗ dotnet ./IP2RegionMaker/bin/IP2RegionMaker.dll --src=../../data/ip.merge.txt --dst=./ip2region.xdb
➜ csharp git:(master) ✗ dotnet ./IP2RegionMaker/bin/IP2RegionMaker.dll --src=../../data/ipv4_source.txt --dst=./ip2region_v4.xdb
# 会看到一堆输出,最终会看到如下输出表示运行成功
...
...