{"id":19534849,"url":"https://github.com/feifeid47/kvfile","last_synced_at":"2026-03-01T17:02:26.986Z","repository":{"id":65904666,"uuid":"602070584","full_name":"feifeid47/KVFile","owner":"feifeid47","description":"key-value文件存储，能将任何可序列化的数据按键值对的方式存储，简单易用，跨平台。适用于配置文件、游戏存档等等","archived":false,"fork":false,"pushed_at":"2023-02-27T03:42:23.000Z","size":12,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T16:23:11.692Z","etag":null,"topics":["csharp","dotnet","file"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feifeid47.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-15T12:42:58.000Z","updated_at":"2024-02-26T15:24:06.000Z","dependencies_parsed_at":"2025-01-08T17:47:29.890Z","dependency_job_id":"09eda1f1-1634-4da6-802a-6f82457e4d82","html_url":"https://github.com/feifeid47/KVFile","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/feifeid47/KVFile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FKVFile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FKVFile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FKVFile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FKVFile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feifeid47","download_url":"https://codeload.github.com/feifeid47/KVFile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FKVFile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29976272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","file"],"created_at":"2024-11-11T02:15:53.984Z","updated_at":"2026-03-01T17:02:26.946Z","avatar_url":"https://github.com/feifeid47.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 介绍\r\n\r\nkey-value文件存储，能将任何可序列化的数据按键值对的方式存储，简单易用，跨平台。\r\n\r\n依赖Newtonsoft.Json。(附Nuget地址：[https://www.nuget.org/packages/Newtonsoft.Json](https://gitee.com/link?target=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FNewtonsoft.Json))\r\n\r\n\r\n\r\n### 存储\r\n\r\n```C#\r\n// public enum Color\r\n// {\r\n//     Red,\r\n//     Blue,\r\n// }\r\n\r\n// public class Person\r\n// {\r\n//     public string name;\r\n//     public int age;\r\n// }\r\n\r\n// public struct Point\r\n// {\r\n//     public int x;\r\n//     public int y;\r\n// }\r\n\r\nvar file = new KVFile(@\"D:\\data.dat\");\r\n// 存储int数据\r\nfile.Set(\"IntValue\", 1);\r\n// 存储float数据\r\nfile.Set(\"FloatValue\", 3.14f);\r\n// 存储double数据\r\nfile.Set(\"DoubleValue\", 3.14);\r\n// 存储string数据\r\nfile.Set(\"StringValue\", \"Hello\");\r\n// 存储枚举\r\nfile.Set(\"EnumValue\", Color.Red);\r\n// 存储对象\r\nfile.Set(\"ObjectValue\", new Person()\r\n{\r\n    name = \"Nick\",\r\n    age = 18\r\n});\r\n// 存储结构体\r\nfile.Set(\"StructValue\", new Point());\r\n// 保存文件\r\nfile.Save();\r\n```\r\n\r\n### 读取\r\n\r\n```C#\r\nvar file = KVFile.Open(@\"D:\\data.dat\");\r\n// 读取int数据\r\nint intValue = file.Get\u003cint\u003e(\"IntValue\");\r\n// 读取float数据\r\nfloat floatValue = file.Get\u003cfloat\u003e(\"FloatValue\");\r\n// 读取double数据\r\ndouble doubleValue = file.Get\u003cdouble\u003e(\"DoubleValue\");\r\n// 读取string数据\r\nstring stringValue = file.Get\u003cstring\u003e(\"StringValue\");\r\n// 读取枚举\r\nColor enumValue = file.Get\u003cColor\u003e(\"EnumValue\");\r\n// 读取对象\r\nPerson objectValue = file.Get\u003cPerson\u003e(\"ObjectValue\");\r\n// 读取结构体\r\nPoint structValue = file.Get\u003cPoint\u003e(\"StructValue\");\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeifeid47%2Fkvfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeifeid47%2Fkvfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeifeid47%2Fkvfile/lists"}