Пример #1
0
        /// <summary>
        /// 加载信息
        /// </summary>
        private void LoadInfo()
        {
            if (!IsPostBack)
            {
                this.txtBase1.Text = BaseConfigService.GetById(13);
                this.txtBase2.Text = BaseConfigService.GetById(12);
                this.txtBase3.Text = BaseConfigService.GetById(13);
                this.txtBase4.Text = BaseConfigService.GetById(14);
                this.txtBase5.Text = BaseConfigService.GetById(15);
                this.txtBase6.Text = BaseConfigService.GetById(16);
                this.txtBase7.Text = BaseConfigService.GetById(17);
                this.txtBase8.Text = BaseConfigService.GetById(18);
                this.txtBase9.Text = BaseConfigService.GetById(19);

                this.txtBase12.Text = BaseConfigService.GetById(20);
                this.txtBase13.Text = BaseConfigService.GetById(21);
                this.txtBase14.Text = BaseConfigService.GetById(22);
                this.txtBase15.Text = BaseConfigService.GetById(23);

                this.tb_id.Text     = BaseConfigService.GetById(39);
                this.tb_secret.Text = BaseConfigService.GetById(40);
                this.tb_URL.Text    = BaseConfigService.GetById(41);
                lblURL1.Text        = BaseConfigService.GetById(24);
                lblURL2.Text        = BaseConfigService.GetById(25);

                lblURL3.Text = BaseConfigService.GetById(26);
                lblURL4.Text = BaseConfigService.GetById(27);

                lblURL5.Text = BaseConfigService.GetById(28);

                txtMonthValue.Text = BaseConfigService.GetById(1);
                txtYearValue.Text  = BaseConfigService.GetById(2);
                txtVideo.Text      = BaseConfigService.GetById(5);
            }
        }
Пример #2
0
        /// <summary>
        /// 生成二维码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnErWeiCode_Click(object sender, EventArgs e)
        {
            string websiteUrl = BaseConfigService.GetById(12);

            if (websiteUrl == "")
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('请设置网站地址!');", true);
                return;
            }
            DataSet ds = UserInfoService.GetList("infoType in (2,3,4)");

            if (ds.Tables[0].Rows.Count > 0)
            {
                string userUrl = "";
                int    id      = 0;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    id      = Convert.ToInt32(ds.Tables[0].Rows[i]["id"]);
                    userUrl = websiteUrl + "/userDetail_" + id + "_1.html";
                    string url = create_two(userUrl, id);
                    //更新二维码信息
                    UserInfoService.UpdateErWeiCode(id, url);
                }
            }
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('生成成功!');", true);
        }
Пример #3
0
        public async Task <ActionResult> Post(PostModel postModel)
        {
            long id     = long.Parse(Request["id"]);
            var  config = await BaseConfigService.GetById(id);

            if (!CheckSignature.Check(postModel.Signature, postModel.Timestamp, postModel.Nonce, config.Token))
            {
                return(Content("参数错误!"));
            }
            postModel.Token          = config.Token;          //根据自己后台的设置保持一致
            postModel.EncodingAESKey = config.EncodingAESKey; //根据自己后台的设置保持一致
            postModel.AppId          = config.Appid;          //wx5d8ab2a66119249e

            //自定义MessageHandler,对微信请求的详细判断操作都在这里面。
            //var messageHandler = new BookMessageHandler(Request.InputStream, postModel, config.DefaultResponse);//接收消息
            Assembly assembly = Assembly.Load("Weixin.Core");
            Type     t        = assembly.GetType("Weixin.Core.BookMessageHandler");

            Object[] constructParms = new object[] { Request.InputStream, postModel, config.DefaultResponse };
            var      messageHandler = Activator.CreateInstance(t, constructParms)
                                      as MessageHandler <MessageContext <IRequestMessageBase, IResponseMessageBase> >;

            messageHandler.Execute();                             //执行微信处理过程
            return(new FixWeixinBugWeixinResult(messageHandler)); //返回结果
        }
Пример #4
0
        /// <summary>
        /// 获取跳转路径
        /// </summary>
        private void JumpURL()
        {
            string weburl = BaseConfigService.GetById(12);
            string src    = CRequest.GetString("src").Replace(weburl, "");

            string url = FriendsInfoService.GetUrl(src);

            Response.Write(url);
        }
Пример #5
0
        public async Task <ContentResult> Get(PostModel postModel, string echostr)
        {
            long id     = long.Parse(Request["id"]);
            var  config = await BaseConfigService.GetById(id);

            if (CheckSignature.Check(postModel.Signature, postModel.Timestamp, postModel.Nonce, config.Token))
            {
                return(Content(echostr)); //返回随机字符串则表示验证通过
            }
            else
            {
                return(Content("failed:" + config.Token + "," + config.Appid + "。" +
                               "如果你在浏览器中看到这句话,说明此地址可以被作为微信公众账号后台的Url,请注意保持Token一致。"));
            }
        }
Пример #6
0
        /// <summary>
        /// 页面标题、关键字和描述信息
        /// </summary>
        private void KeyWordBind()
        {
            string url = Request.Url.ToString().Replace("aspx", "html");

            KeyWordInfo km = KeyWordInfoService.GetModel(url);

            if (km != null)
            {
                ViewState["title"]   = km.title;
                ViewState["keyword"] = km.keyword;
                ViewState["miaoshu"] = km.description;
            }
            else
            {
                ViewState["title"]   = BaseConfigService.GetById(9);
                ViewState["keyword"] = BaseConfigService.GetById(23);
                ViewState["miaoshu"] = BaseConfigService.GetById(13);
            }
        }
Пример #7
0
 /// <summary>
 /// 加载信息
 /// </summary>
 private void LoadInfo()
 {
     lblImgWeiBo.Text    = BaseConfigService.GetById(11111);
     this.content2.Value = BaseConfigService.GetById(11112);
 }