Пример #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     setupClient();
     UCFeed feed = new UCFeed();
     feed.Uid = 1;
     feed.Icon = "1";
     feed.Username = "******";
     feed.TitleData = "ads";
     feed.TitleTemplate = "a{a}a";
     feed.BodyData = "aaaaaaa";
     feed.BodyGeneral = "";
     feed.BodyTemplate = "dd";
     feed.TargetIDs = "1,2";
     feed.Images[0] = new UCFeedImage("http://ddd", "link1");
     feed.Images[1] = new UCFeedImage("http://ddd", "link2");
     textBoxResponse.Text = m_client.UcenterAddFeed(feed);
 }
Пример #2
0
        /// <summary>
        /// ���������� feed �ӿ�
        /// </summary>
        /// <param name="feed"></param>
        /// <returns></returns>
        public string UcenterAddFeed(UCFeed feed)
        {
            UCRequestParms parms = new UCRequestParms();

            parms["appid"] = this.Appid;
            parms["icon"] = feed.Icon;
            parms["uid"] = feed.Uid.ToString();
            parms["username"] = feed.Username;
            parms["title_template"] = feed.TitleTemplate;
            parms["title_data"] = feed.TitleData;
            parms["body_template"] = feed.BodyData;
            parms["body_data"] = feed.BodyData;
            parms["body_general"] = feed.BodyGeneral;
            parms["target_ids"] = feed.TargetIDs;

            int j;
            for( int i = 0; i < 4; i++)
            {
                j = i + 1;
                parms[string.Format("images_{0}_url", j.ToString())] = feed.Images[i].Url;
                parms[string.Format("images_{0}_link", j.ToString())] = feed.Images[i].Link;
            }

            return DoRequest("feed", "add", parms);
        }