Пример #1
0
        public static bool UpdateGroup(券商 o)
        {
            try
            {
                var groupJson = (new GroupInfo(o)).ToJson();
                CommonUtils.SetConfig(o.称, Cryptor.MD5Encrypt(groupJson));

                if (o.ClientID == -1 && o.启用)
                {
                    o.Start();
                }
            }
            catch (Exception ex)
            {
                CommonUtils.Log("新增或编辑组合号出错", ex);
                return(false);
            }
            return(true);
        }
Пример #2
0
 public bool Login(string userName, string password)
 {
     try
     {
         bool isLogon = "admin" == userName && CommonUtils.GetConfig("password") == Cryptor.MD5Encrypt(password);
         if (isLogon)
         {
             if (dictLogon.ContainsKey(userName))
             {
                 dictLogon[userName] = DateTime.Now;
             }
             else
             {
                 dictLogon.Add(userName, DateTime.Now);
                 CommonUtils.Log(string.Format("用户'{0}'登录成功 ", Cryptor.MD5Decrypt(userName)));
             }
         }
         return(isLogon);
     }
     catch (Exception ex)
     {
         CommonUtils.Log(ex.Message);
         return(false);
     }
 }