简体   繁体   中英

How to Deserialize this object JSON?

I need deserialize a json like this:

{"success":true,"loggedin":false,"data":{"accessTime":1285167129}}

My objects are:

public class Heartbeat
{
    public bool Success { get; set; }
    public bool Loggedin { get; set; }

    public HeartbeatData Data { get; set; }
}

public class HeartbeatData
{
    public int AccessTime { get; set; }
}

But HeartbeatData doesn´t serialize.

尝试使用JSON.net来查看是否可行,然后我们看看是Hammock还是C#引起了该问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM