Пример #1
0
 private void UpdateGroup(券商 Group)
 {
     try
     {
         var matchItem = Regex.Match(txtServerInfo.Text, "([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}):([0-9]+)");
         if (matchItem.Success && string.IsNullOrEmpty(txtIP.Text) || string.IsNullOrEmpty(txtPort.Text))
         {
             txtIP.Text   = matchItem.Groups[1].Value;
             txtPort.Text = matchItem.Groups[2].Value;
         }
         Group.IP    = txtIP.Text.Trim();
         Group.Port  = short.Parse(txtPort.Text.Trim());
         Group.版本号   = txtVersion.Text.Trim();
         Group.登录帐号  = txtLogAccount.Text.Trim();
         Group.交易服务器 = txtServerInfo.Text;
         Group.交易密码  = Cryptor.MD5Encrypt(txtTradePsw.Text);
         Group.交易帐号  = txtTradeAccount.Text.Trim();
         Group.称     = txtName.Text.Trim();
         Group.启用    = cbIsUse.Checked;
         Group.通讯密码  = Cryptor.MD5Encrypt(txtCommunicatePsw.Text);
         Group.营业部代码 = short.Parse(txtDepartment.Text.Trim());
         CommonUtils.SetConfig(Group.称, Cryptor.MD5Encrypt(Group.ToJson()));
     }
     catch (Exception ex)
     {
         ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", string.Format("<script>alert('修改异常,{0}!');</script>", ex.Message));
     }
 }
Пример #2
0
        protected void btnLogon_Click(object sender, EventArgs e)
        {
            bool isLogon = CommonUtils.GetConfig("user") == Cryptor.MD5Encrypt(txtUserName.Value) && CommonUtils.GetConfig("psw") == Cryptor.MD5Encrypt(txtPsw.Value);

            if (isLogon)
            {
                Session["username"] = txtUserName.Value;
                Response.Redirect("Manage.aspx");
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('用户名或密码错误!');</script>");
            }
        }