예제 #1
0
        public override void Send(WeiboMessage message)
        {
            TokenResult tokenResult = VerifyAccessToken(sinaClient);

            try
            {
                if (tokenResult == TokenResult.Success)
                {
                    if (message.PicUrl != null)
                    {
                        var entity = sinaClient.API.Entity.Statuses.UploadUrlText(message.Content + message.Url, message.PicUrl);
                    }
                    else
                    {
                        var entity = sinaClient.API.Entity.Statuses.Update(message.Content + message.Url);
                    }
                }
                else
                {
                    throw new CustomException.TokenVerificationException() { TokenResult = tokenResult, Message = "Token异常" };
                }
            }
            catch (Exception ex)
            {
                throw new CustomException.SendWeiboException() { Message = "发送微薄出错:" + ex.Message };
            }
        }
예제 #2
0
 /// <summary>
 /// 发送单条微薄
 /// </summary>
 /// <param name="message">微薄内容</param>
 public abstract void Send(WeiboMessage message);