Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     appId = System.Configuration.ConfigurationManager.AppSettings["AppId"];
     var appSecret = System.Configuration.ConfigurationManager.AppSettings["AppSecret"];
     JsSdkHelper jssdk = new JsSdkHelper(appId, appSecret);
     Hashtable hs = jssdk.getSignPackage();
     signature = hs["signature"].ToString();
     timestamp = hs["timestamp"].ToString();
     nonce = hs["nonceStr"].ToString();
 }
Beispiel #2
0
        /// <summary>
        /// https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115
        /// https://www.cnblogs.com/wangqiideal/p/8041724.html
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var         appId     = System.Configuration.ConfigurationManager.AppSettings["AppId"];
            var         appSecret = System.Configuration.ConfigurationManager.AppSettings["AppSecret"];
            JsSdkHelper jssdk     = new JsSdkHelper(appId, appSecret);
            Hashtable   hs        = jssdk.getSignPackage();
            string      signature = hs["signature"].ToString();
            string      timestamp = hs["timestamp"].ToString();
            string      nonce     = hs["nonceStr"].ToString();

            return(View());
        }