コード例 #1
0
        public static string CmdModyPwd(Mdfy_Pwd_Info modyInfo)
        {
            string ErrInfo = "";

            try
            {
                //找出传递过来的用户名和密码
                string name      = "";
                string oldpasswd = "";
                string newpasswd = "";
                if (modyInfo.key == "110")
                {
                    name      = modyInfo.name;
                    oldpasswd = modyInfo.oldpasswd;
                    newpasswd = modyInfo.newpasswd;

                    ErrInfo = CSGHelper.ModifyPwd(name, oldpasswd, newpasswd);
                    LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "ModifyPwd name:" + name + "\toldpasswd:" + oldpasswd + "\tnewpasswd:" + newpasswd, new StackTrace(new StackFrame(true)));
                }
                else
                {
                    name      = CSecurity.DecryptDES(modyInfo.name, modyInfo.key);
                    oldpasswd = CSecurity.DecryptDES(modyInfo.oldpasswd, modyInfo.key);
                    newpasswd = CSecurity.DecryptDES(modyInfo.newpasswd, modyInfo.key);
                    if (name == modyInfo.name || oldpasswd == modyInfo.oldpasswd ||
                        newpasswd == modyInfo.newpasswd)
                    {
                        ErrInfo = "修改失败,请稍后再试!";
                    }
                    else
                    {
                        ErrInfo = CSGHelper.ModifyPwd(name, oldpasswd, newpasswd);
                        LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "ModifyPwd name:" + name + "\toldpasswd:" + oldpasswd + "\tnewpasswd:" + newpasswd, new StackTrace(new StackFrame(true)));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, ex.Message, new StackTrace(new StackFrame(true)));
                ErrInfo = "注册失败,请稍后再试!";
            }


            return(ErrInfo);
        }
コード例 #2
0
        public static string CmdRegister(Rg_Info rg_info)
        {
            string ErrInfo = "";

            try {
                //找出传递过来的用户名和密码
                string name   = "";
                string passwd = "";
                if (rg_info.key == "110")
                {
                    name    = rg_info.name;
                    passwd  = rg_info.passwd;
                    ErrInfo = CSGHelper.CreateAccount(name, passwd);
                    LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "CreateAccount name:" + name + "\tpasswd:" + passwd + "\t" + ErrInfo, new StackTrace(new StackFrame(true)));
                }
                else
                {
                    name   = CSecurity.DecryptDES(rg_info.name, rg_info.key);
                    passwd = CSecurity.DecryptDES(rg_info.passwd, rg_info.key);
                    if (name == rg_info.name || passwd == rg_info.passwd)
                    {
                        ErrInfo = "注册失败,请稍后再试!";
                    }
                    else
                    {
                        ErrInfo = CSGHelper.CreateAccount(name, passwd);
                        LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "CreateAccount name:" + name + "\tpasswd:" + passwd, new StackTrace(new StackFrame(true)));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, ex.Message, new StackTrace(new StackFrame(true)));
                ErrInfo = "注册失败,请稍后再试!";
            }


            return(ErrInfo);
        }