示例#1
0
        private void BindData()
        {
            this.hdfCopyUrl.Value   = this.txtUrl.Text = string.Format("http://{0}/api/AliPayFuwuApi.ashx", base.Request.Url.Host);
            this.hdfCopyToken.Value = this.txtToken.Text = string.Format("http://{0}/api/AliPayFuwuApi.ashx", base.Request.Url.Host);
            this.RSAPublic.Value    = this.txtRSA.Text = RsaKeyHelper.GetRSAKeyContent(base.Server.MapPath("~/config/rsa_public_key.pem"), true);
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.txtAliAppId.Text       = masterSettings.AlipayAppid;
            this.txtAliFollowTitle.Text = masterSettings.AliOHFollowRelayTitle;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         SiteSettings masterSettings = SettingsManager.GetMasterSettings();
         string       path           = base.Server.MapPath("~/config/rsa_public_key.pem");
         string       text           = File.Exists(path) ? RsaKeyHelper.GetRSAKeyContent(path, true) : this.CreateRsaKey();
         this.txtAppId.Text      = masterSettings.AliOHAppId;
         this.txtAppWelcome.Text = masterSettings.AliOHFollowRelay;
         this.txtUrl.Text        = $"http://{base.Request.Url.Host}/api/alipay.ashx";
         this.txtPubKey.Text     = text;
     }
 }
示例#3
0
        private string CreatePubKeyContent()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            string       path           = base.Server.MapPath("~/config/rsa_public_key.pem");
            string       result;

            if (!File.Exists(path))
            {
                result = this.CreateRsaKey();
                SettingsManager.Save(masterSettings);
            }
            else
            {
                result = RsaKeyHelper.GetRSAKeyContent(path, true);
            }
            return(result);
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string       rSAKeyContent;
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         string       path           = base.Server.MapPath("~/config/rsa_public_key.pem");
         if (!File.Exists(path))
         {
             rSAKeyContent = this.CreateRsaKey();
             SettingsManager.Save(masterSettings);
         }
         else
         {
             rSAKeyContent = RsaKeyHelper.GetRSAKeyContent(path, true);
         }
         this.txtAppId.Text      = masterSettings.AliOHAppId;
         this.txtAppWelcome.Text = masterSettings.AliOHFollowRelay;
         this.txtUrl.Text        = string.Format("http://{0}/api/alipay.ashx", base.Request.Url.Host);
         this.txtPubKey.Text     = rSAKeyContent;
     }
 }