天天看點

序列化與反序列化

序列化(serializeobject)與反序列化(deserializeobject)。

打開nuget安裝newtonsoft.json:

序列化與反序列化
序列化與反序列化
序列化與反序列化
序列化與反序列化

source code

list<string> a經過序列化之後,傳回的結果:

序列化與反序列化

接來來,我們把經過序列化後的s,再反序列化回list<string>集合:

序列化與反序列化
序列化與反序列化
序列化與反序列化

控制台測試并輸出結果:

序列化與反序列化

繼續閱讀