C# Class SoftwareKobo.Social.Sina.Weibo.WeiboClient

处理新浪微博的授权与分享。
Afficher le fichier Open project: h82258652/SoftwareKobo.Social.Sina.Weibo Class Usage Examples

Méthodes publiques

Méthode Description
ClearAuthorize ( ) : void

清除本地授权数据。

CreateAsync ( ) : Task

创建分享对象,若需要,则弹出授权窗口。

ShareImageAsync ( byte image, string text ) : Task

分享图片到微博

执行完成后请检查对象的 IsSuccess 属性,以获取是否成功

ShareTextAsync ( string text ) : Task

分享文本到微博中。

执行完成后请检查对象的 IsSuccess 属性,以获取是否成功

Private Methods

Méthode Description
Authorize ( string authorizeCode ) : System.Threading.Tasks.Task

使用授权码换取 AccessToken,并保存到缓存中。

GetAuthorizeCodeAsync ( ) : Task

获取授权码,将会弹出授权窗口。

WeiboClient ( ) : Newtonsoft.Json

Method Details

ClearAuthorize() public static méthode

清除本地授权数据。
public static ClearAuthorize ( ) : void
Résultat void

CreateAsync() public static méthode

创建分享对象,若需要,则弹出授权窗口。
用户取消授权获取授权过程中网络异常。 获取 AccessToken 过程中网络异常。
public static CreateAsync ( ) : Task
Résultat Task

ShareImageAsync() public méthode

分享图片到微博
执行完成后请检查对象的 IsSuccess 属性,以获取是否成功
image 为 null text 为 null text 为空字符串 授权已过期,并且用户取消重新授权 网络异常
public ShareImageAsync ( byte image, string text ) : Task
image byte 图片数据
text string 图片描述
Résultat Task

ShareTextAsync() public méthode

分享文本到微博中。
执行完成后请检查对象的 IsSuccess 属性,以获取是否成功
text 为 null text 为空白字符串 授权已过期,并且用户取消重新授权 网络异常
public ShareTextAsync ( string text ) : Task
text string 需要分享的文本
Résultat Task