Ejemplo n.º 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        IList <EncryptionSetting> ess = new List <EncryptionSetting>();

        for (int i = 0; i < gvSetting.Rows.Count; i++)
        {
            EncryptionSetting es = new EncryptionSetting();
            es.EncryptionKey   = (gvSetting.Rows[i].FindControl("hidKey") as HtmlInputHidden).Value;
            es.EncryptionValue = (gvSetting.Rows[i].FindControl("ckbValue") as CheckBox).Checked ? 1 : 0;
            ess.Add(es);
        }

        Application["jinzhi"] = "HDG";
        if (EncryptionBLL.EditSetting(ess))
        {
            msg = "<script>alert('" + GetTran("005820", "设置成功!") + "');</script>";
        }
        else
        {
            msg = "<script>alert('" + GetTran("005821", "设置失败!!") + "');</script>";
        }
        Application["jinzhi"] = "";

        Bind();
    }
Ejemplo n.º 2
0
        public PortalCryptoAlgorithm(
            IHttpContextAccessor httpContextAccessor,
            IDiscoveryCache discoveryCache,
            IDataProtectionProvider dataProtectionProvider,
            EncryptionSetting encryptionSetting)
        {
            _httpContextAccessor = httpContextAccessor;
            _discoveryCache      = discoveryCache;
            _encryptionSetting   = encryptionSetting;

            _dataProtector = dataProtectionProvider.CreateProtector(nameof(PortalCryptoAlgorithm));
        }