Ejemplo n.º 1
0
        /// <summary>
        /// 查询Souler主页
        /// </summary>
        /// <param name="userIdEcpt"></param>
        /// <returns></returns>
        public static QuerySoulerHomepageResponse QuerySoulerHomepage(string userIdEcpt)
        {
            string json = Sender.Get($"https://api.soulapp.cn/html/v2/post/homepage?userIdEcpt={userIdEcpt}");
            QuerySoulerHomepageResponse response = JsonConvert.DeserializeObject <QuerySoulerHomepageResponse>(json);

            return(response);
        }
Ejemplo n.º 2
0
        public SoulerForm(string uid, QuerySoulerInfoResponse soulerInfo, Image img)
        {
            InitializeComponent();
            soulerID = uid;

            // 标题
            this.Text = $"{soulerInfo.data.signature} - {Application.ProductName}";

            // 用户头像
            picSouler.Image     = img;
            picSouler.BackColor = ((Bitmap)img).GetPixel(0, 0);

            QuerySoulerHomepageResponse response = SoulAPI.QuerySoulerHomepage(uid);

            foreach (DataItem data in response.data)
            {
                KeyValueListItem item = new KeyValueListItem();

                var nowTime = new DateTime(1970, 1, 1, 8, 0, 0).AddMilliseconds(data.createTime);

                item.Key   = $"{nowTime.Month}月{nowTime.Day}日";
                item.Value = data.content;

                msgList.Items.Add(item);
            }
        }