最简单的方法序列化和在C#中存储对象?最简单、对象、序列化、方法

2023-09-04 10:11:27 作者:simple

林寻找一个简单的解决方案,以序列化和包含的配置,应用程序状态和数据存储对象。它是一种简单的应用程序,它的不是很多的数据。速度是没有问题的。我想这是在进程。我希望它是更易于编辑的文本编辑比XML。

Im looking for a simple solution to serialize and store objects that contain configuration, application state and data. Its a simple application, its not alot of data. Speed is no issue. I want it to be in-process. I want it to be more easy-to-edit in a texteditor than xml.

我无法找到.NET,可以处理它,过程中的任何文件数据库。 只需序列化到XML林不知道我想要做的,因为它的... XML。 序列化到JSON似乎很具体的javascript,而且我不会在JavaScript中使用这些数据。

I cant find any document database for .net that can handle it in-process. Simply serializing to xml Im not sure I want to do because its... xml. Serializing to JSON seems very javascript specific, and I wont use this data in javascript.

我想,有非常整洁的方式来做到这一点,但ATM IM偏向于使用JSON,尽管它的JavaScript inclenation。

I figure there's very neat ways to do this, but atm im leaning to using JSON despite its javascript inclenation.

推荐答案

正因为JSON这是一个缩写JavaScript对象符号,有它是否符合您的需要或不作为的数据格式上没有相关性。 JSON是轻量级的,基于文本的,很容易可读/可编辑的,它是尽管名称的语言无关的格式。

Just because "JSON" it's an acronym for JavaScript Object Notation, has no relevance on if it fits your needs or not as a data format. JSON is lightweight, text based, easily human readable / editable and it's a language agnostic format despite the name.

我肯定会倾向于使用它瘦,因为它的声音pretty的理想您的具体情况。

I'd definitely lean toward using it, as it sounds pretty ideal for your situation.