Beispiel #1
0
		private void PostImageStatus(SinaWeiboClient openAuth)
		{
			console.info("发布一条图片微博...");

			var imgPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"MrJSON-Production.png");
			var result = openAuth.HttpPost("statuses/upload.json", new Dictionary<string, object> {

				{"status" , string.Format("发布自SinaWeiboSDK_V3@{0:HH:mm:ss}", DateTime.Now)},
				{"pic" , new FileInfo(imgPath)}
			});

			console.attention("{0}", result);


			if (result.IsSuccessStatusCode)
			{

				console.data(result.Content.ReadAsStringAsync().Result);
				console.info("发布成功!");
			}
		}
Beispiel #2
0
		private void PostStatus(SinaWeiboClient openAuth)
		{
			console.info("发布一条微博...");


			var result = openAuth.HttpPost("statuses/update.json", new Dictionary<string, object>
			{
				{"status" , string.Format("发布自SinaWeiboSDK_V3@{0:HH:mm:ss}", DateTime.Now)}
			});

			console.attention("{0}", result);
			if (result.IsSuccessStatusCode)
			{

				console.data(result.Content.ReadAsStringAsync().Result);
				console.info("发布成功!");
			}
		}