.net服务端使用Newtonsoft.Json.dll组件输出json

使用Newtonsoft.Json.dll组件输出json:

 

var result = new
            {
                ResultCode = allDone == 0 ? -1 : 0,
                QueryUserInfoResp = getUserInfo(),
                WhoAddMeByPageResp = getWhoAddMeCount(),
                ISyncRecentTime = getSyncTime(iContactServiceBLL.FROM_FORUM),
                SyncTime12580 = getSyncTime(iContactServiceBLL.FROM_12580)
            };
            JsonSerializer js = new JsonSerializer();
            js.Serialize(new JsonTextWriter(context.Response.Output), result);

posted on 2011-08-09 13:44  伊伦  阅读(874)  评论(0编辑  收藏  举报

导航