private static void ParseProperties(JoinToken es, HttpContextBase hcb = null) { if (es == null) { return; } var ps = es.GetType().GetProperties(); foreach (var p in ps) { if (hcb == null) { var context = HttpContext.Current; if (context == null) { return; } p.SetValue(es, context.Request[p.Name], null); } else { p.SetValue(es, hcb.Request[p.Name], null); } } }
/// <summary> /// /// </summary> public static JoinToken ParseJoinToken() { var result = new JoinToken(); ParseProperties(result); return(result); }
/// <summary> /// /// </summary> public static JoinToken ParseJoinToken(HttpContextBase context = null) { var result = new JoinToken(); ParseProperties(result, context); return(result); }
private static void ParseProperties(JoinToken es) { if (es == null) return; var ps = es.GetType().GetProperties(); foreach (var p in ps) { var context = HttpContext.Current; if (context == null) return; p.SetValue(es, context.Request[p.Name], null); } }
/// <summary> /// 接入微信 /// </summary> /// <returns></returns> public static bool Join(IMsgCall call, WeChatParam param = null) { var sign = ParseJoinToken(); if (sign.Check(param)) { if (JoinToken.IsGetRequest()) { sign.Response(); } else { ReceiveMsg.Reg(call); } return(true); } return(false); }
private static void ParseProperties(JoinToken es) { if (es == null) { return; } var ps = es.GetType().GetProperties(); foreach (var p in ps) { var context = HttpContext.Current; if (context == null) { return; } p.SetValue(es, context.Request[p.Name], null); LogHelper.Debug("ParseProperties)" + p.Name + ":" + context.Request[p.Name], "微信CallBack_"); } }
/// <summary> /// /// </summary> public static JoinToken ParseJoinToken(HttpContextBase context = null) { var result = new JoinToken(); ParseProperties(result, context); return result; }
/// <summary> /// /// </summary> public static JoinToken ParseFromContext() { var result = new JoinToken(); ParseProperties(result); return result; }