![]() |
VOOZH | about |
dotnet add package HKW.TOML --version 2.3.0
NuGet\Install-Package HKW.TOML -Version 2.3.0
<PackageReference Include="HKW.TOML" Version="2.3.0" />
<PackageVersion Include="HKW.TOML" Version="2.3.0" />Directory.Packages.props
<PackageReference Include="HKW.TOML" />Project file
paket add HKW.TOML --version 2.3.0
#r "nuget: HKW.TOML, 2.3.0"
#:package HKW.TOML@2.3.0
#addin nuget:?package=HKW.TOML&version=2.3.0Install as a Cake Addin
#tool nuget:?package=HKW.TOML&version=2.3.0Install as a Cake Tool
GitHub
HKW.TOML 是使用 C# 编写的
包含有 TOML 的读取和编写, 序列化反序列化, 生成 C# 实体类等功能
其中 读取器和编写器 修改至Tommy
可以添加单独的 TomlParse.cs 文件以只使用读取器和编写器功能
或者从NuGet包中获取完整功能
TomlTable table = TOML.Parse(TomlExample.ExampleData);
//TomlTable table = TOML.ParseFromFile(TomlExample.ExampleFile);
string title = table["title"].AsString;
string titleComment = table["title"].Comment;
List<int> numbers = table["integers"].AsList.Select(node => node.AsInt32).ToList();
TomlTable table =
new()
{
new TomlString("TOML example \\U0001F60A")
{
Comment = "Simple key/value with a string."
},
new TomlArray() { 42, 0x42, 042, 0b0110 }
};
生成相关设置请查看TomlAsClassesOptions
TomlTable table = TOML.Parse(TomlExample.ExampleData);
string classString = TomlAsClasses.Generate(table, "ClassExample");
Console.WriteLine(classString);
反序列化相关设置请查看TomlDeserializerOptions
TomlTable table = TOML.Parse(TomlExample.ExampleData);
ClassExample example = TomlDeserializer.Deserialize<ClassExample>(table);
序列化相关设置请查看TomlSerializerOptions
TomlTable table = TOML.Parse(TomlExample.ExampleData);
ClassExample example = TomlDeserializer.Deserialize<ClassExample>(table);
TomlTable serializeTable = TomlSerializer.Serialize(example);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0 | 282 | 8/10/2025 |
| 2.2.8 | 319 | 8/5/2025 |
| 2.2.7 | 452 | 7/25/2025 |
| 2.2.6 | 522 | 7/21/2025 |
| 2.2.5 | 508 | 7/21/2025 |
| 2.2.4 | 518 | 7/21/2025 |
| 2.2.3 | 429 | 7/20/2025 |
| 2.2.2 | 254 | 7/10/2025 |
| 2.2.1 | 270 | 7/10/2025 |
| 2.2.0 | 249 | 7/9/2025 |
| 2.1.0 | 321 | 1/19/2024 |
| 2.0.0 | 287 | 12/21/2023 |
| 1.3.1 | 261 | 11/22/2023 |
| 1.3.0 | 236 | 10/9/2023 |
| 1.2.1 | 246 | 9/20/2023 |
| 1.2.0 | 268 | 8/22/2023 |
| 1.1.7 | 313 | 5/8/2023 |