The .NET Core implementation for looking up Chinese administrative divisions.
The latest GB/T 2260 codes. Read the GB2260 Specification.
Install with nuget:
Install-Package GB2260.Core
GB2260 gb = Gb2260Factory.Create(); // with default revision 201607
GB2260 gb = Gb2260Factory.Create(Revision.V201607); // specify the revision
Interface for GB2260.
Get division for the given code.
Division division = gb.GetDivision("110105")
// 北京市 市辖区 朝阳区
division.Name
// 朝阳区
division.Code
// 110105
(int)division.Revision
// 201607
division.GetProvince()
// 北京市
division.GetPrefecture()
// 市辖区
division.ToString()
// 北京市 市辖区 朝阳区
Return a list of provinces in Division data structure.
gb.GetProvinces()
Return a list of prefecture level cities in Division data structure.
gb.GetPrefectures("110000")
Return a list of counties in Division data structure.
gb.GetCounties("110100")
Revision
contains a list of available revisions.
(int)Revision.V201607 // return 201607
MIT.