Exemplo n.º 1
0
        private void btn_AcountAdd_Click(object sender, EventArgs e)
        {
            string account = txt_AcountName.Text;
            string pwd     = txt_AcountPwd.Text;
            string result  = CSGHelper.CreateAccount(account, pwd);

            MessageBox.Show(result);
        }
Exemplo n.º 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);
        }