Beispiel #1
0
        /// <summary>
        /// 请上下文获取验证数据。
        /// </summary>
        /// <returns></returns>
        public static EntrySign ParseFromContext()
        {
            var ret = new EntrySign();

            ParseMetadata(ret);
            return(ret);
        }
Beispiel #2
0
        private static void ParseMetadata(EntrySign 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);
            }
        }