protected override void OnInit(EventArgs e) { string PostType = Request["PostType"]; if (string.IsNullOrEmpty(PostType)) { base.OnInit(e); return; } Common.Helper.mJsonResult json = new Common.Helper.mJsonResult(); switch (PostType) { case "getWechatImage": GetWechatImage(); //从微信服务器上获取图片 break; default: break; } if (json != null) { string retStr = json.ToJson(); Response.Write(retStr); Response.End(); } }
protected override void OnInit(EventArgs e) { string PostType = Request["PostType"]; if (string.IsNullOrEmpty(PostType)) { base.OnInit(e); return; } Common.Helper.mJsonResult json = new Common.Helper.mJsonResult(); switch(PostType) { case "getWechatImage": GetWechatImage();//从微信服务器上获取图片 break; default: break; } if(json!=null) { string retStr = json.ToJson(); Response.Write(retStr); Response.End(); } }
public static string ToJson(this mJsonResult mJsonResult) { return(Newtonsoft.Json.JsonConvert.SerializeObject(mJsonResult)); }