private void PostStatus(QQConnectClient openAuth) { console.info("发布一条微博..."); var result = openAuth.HttpPost("t/add_t", new Dictionary<string, object> { {"content", string.Format("发布自WeiboSDK_V3@{0:HH:mm:ss}", DateTime.Now)} }); if (result.IsSuccessStatusCode) { console.data(result.Content.ReadAsStringAsync().Result); console.info("发布成功!"); } }
private void PostImageStatus(QQConnectClient openAuth) { console.info("发布一条图片微博..."); var imgPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"MrJSON-Production.png"); var buff = File.ReadAllBytes(imgPath); var result = openAuth.HttpPost("t/add_pic_t", new Dictionary<string, object> { {"content" , string.Format("SDK TEST {0:HH:mm:ss}", DateTime.Now)}, {"pic" , buff} }); if (result.IsSuccessStatusCode) { console.data(result.Content.ReadAsStringAsync().Result); console.info("发布成功!"); } }