Exemple #1
0
        public static user GetUser(string uid)
        {
            user   u   = new user();
            string ret = Cos.find(@"user/(" + uid + ")");

            if (ret != "")
            {
                string[] usern = ret.Replace(@"user/", "").Replace("(", "").Replace(")", "").Split(',');
                u.uid     = uid;
                u.regtime = usern[1];
                u.pwd     = usern[2];
                u.endtime = usern[3];
                u.utime   = usern[4];
                u.sunum   = usern[5];
                u.unum    = usern[6];
                u.mcode   = usern[7];
            }
            return(u);
        }
Exemple #2
0
        public static bool SetUser(user u)
        {
            string ret = Cos.find(@"user/(" + u.uid + ")");

            if (ret != "")
            {
                string[] usern = ret.Replace(@"user/", "").Replace("(", "").Replace(")", "").Split(',');
                u.regtime = Common.EmptyToStr(u.regtime, usern[1]);
                u.pwd     = Common.EmptyToStr(u.pwd, usern[2]);
                u.endtime = Common.EmptyToStr(u.endtime, usern[3]);
                u.utime   = Common.EmptyToStr(u.utime, usern[4]);
                u.sunum   = Common.EmptyToStr(u.sunum, usern[5]);
                u.unum    = Common.EmptyToStr(u.unum, usern[6]);
                u.mcode   = Common.EmptyToStr(u.mcode, usern[7]);
                if (AddUser(u))
                {
                    if (Cos.Del(ret) == 204)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemple #3
0
 public static bool DelUser(string uid)
 {
     return(204 == Cos.Del(Cos.find(@"user/(" + uid + ")")));
 }