示例#1
0
        public void sendarticle(string text, string openid)
        {
            string[]               str         = openid.Split('|');
            Business.article       article     = new Business.article();
            Business.articleData[] articledata = article.Select(text);
            string imgfile = "../uploads/" + articledata[0].thumb_media_id;
            var    img     = MaterialLib.Add(HttpContext.Current.Server.MapPath(imgfile), AccessTokenBox.GetTokenValue(), MaterialType.image);
            var    ret     = GroupSend.UpLoadNew(new List <Article> {
                new Article
                {
                    title              = articledata[0].title,
                    author             = articledata[0].author,
                    content            = articledata[0].content,
                    content_source_url = "https://www.baidu.com/",
                    digest             = articledata[0].digest,
                    show_cover_pic     = 1,
                    thumb_media_id     = img.media_id
                }
            }, AccessTokenBox.GetTokenValue());

            var ss = WxApi.GroupSend.SendArticleByOpenID(ret.media_id, AccessTokenBox.GetTokenValue(), str);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    Business.article       article     = new Business.article();
                    Business.articleData[] articledata = article.Select(Request.QueryString["id"]);

                    Business.users.file = articledata[0].thumb_media_id;
                    author.Text         = articledata[0].author;
                    title.Text          = articledata[0].title;
                    //content_source_url.Text = articledata[0].content_source_url;
                    txtcontent.Text = articledata[0].content;
                    digest.Text     = articledata[0].digest;
                    //show_cover_pic.Text = articledata[0].show_cover_pic;


                    article     = null;
                    articledata = null;
                }
            }
        }