使用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);