Exemplo n.º 1
0
        public static UserInfoClass GetUserInfo(string json)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            UserBaseInfo         bi         = null;

            try
            {
                bi = serializer.Deserialize <UserBaseInfo>(json);  //序列化:对象=>JSON字符串
            }
            catch (Exception ce)
            {
                return(null);
            }
            ////Response.Write(jsonStr);
            ////if (bi == null)
            ////{
            ////    return null;
            ////}

            UserInfoClass ret = new UserInfoClass();

            ret.BaseInfo = bi;
            ////ret.BaseInfo = new UserBaseInfo();
            ////ret.BaseInfo.UserCode = bi["UserCode"].ToString();
            ////ret.BaseInfo.Password = bi["Password"].ToString();
            ////DateTime.TryParse(bi["ExpireDate"].ToString(), out ret.BaseInfo.ExpireDate);
            ////ret.BaseInfo.Odds = double.Parse(bi["Odds"].ToString());
            return(ret);
        }
Exemplo n.º 2
0
 public UserInfoClass()
 {
     BaseInfo = new UserBaseInfo();
 }