惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
B
Blog
月光博客
月光博客
博客园 - 【当耐特】
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
博客园 - Franky
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
B
Blog RSS Feed
H
Help Net Security

博客园 - 大豆男生

C# 和 OpenResty 中进行 CRC32 Linq分组后,再对分组后的每组数据进行排序,获取每组的第一条记录 WebClient 指定安全协议(Tls1.1,Tls1.2,Tls1.3) .Net Core 中的 MurmurHash VS2019 .Net Core 3.0 Web 项目启用动态编译 IIS 上部署 ASP.NET Core 应用程序 IIS (安装SSL证书后) 实现 HTTP 自动跳转到 HTTPS 使用浏览器自定义协议启动本地程序(.EXE文件) 再谈 C# 对象二进制序列化,序列化并进行 AES 加密 腾讯防水墙(滑动验证码)的简单使用 https://007.qq.com C# 使用 PerformanceCounter 获取 CPU 和 硬盘的使用率 .Net 控制台中文(简体/繁体)乱码问题 .Net Core 使用 System.Drawing.Common 部署到CentOS上遇到的问题 .Net Core 读取配置文件 appsettings.json JavaScript 获取按键,并屏蔽系统 Window 事件 frp 初探 nginx 禁止未绑定的域名访问 .NET MVC JSON JavaScriptSerializer 字符串的长度超过 maxJsonLength 值问题的解决 async,await,Task 的一些用法
Newtonsoft.Json(Json.net) 的使用
大豆男生 · 2017-03-30 · via 博客园 - 大豆男生

 Newtonsoft.Json(Json.net) 的使用

//Newtonsoft.Json.dll
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public static class JConvert
{
    private static IsoDateTimeConverter datetimeimeFormat;
    static JConvert()
    {
        datetimeimeFormat = new IsoDateTimeConverter();
        datetimeimeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
    }

    public static string Serialize(object value)
    {
        return  JsonConvert.SerializeObject(value, Formatting.Indented, datetimeimeFormat);
    }

    public static T Deserialize<T>(string value)
    {
        return JsonConvert.DeserializeObject<T>(value);
    }
}