引入Newtonsoft.Json
定义接收对象
public class RootObject
{
public string access_token { get; set; }
public string token_type { get; set; }
public string expires_in { get; set; }
public string scope { get; set; }
}
序列化json
RootObject rb = JsonConvert.DeserializeObject(ret);
获取 rb.access_token;
c# 解析json
最新推荐文章于 2023-09-26 16:43:23 发布