如何使用来自ASP.NET站点的Twitterizer API在Twitter上发布带有小图像的twit ... [英] How to post twit with small image in twitter using Twitterizer API from ASP.NET site...

查看:65
本文介绍了如何使用来自ASP.NET站点的Twitterizer API在Twitter上发布带有小图像的twit ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我已经使用 Twitterizer API库在我的asp.net网站上集成了在Twitter上发布twit的代码。请参阅下面的代码



Hello,
I have integrated code to post twit on twitter from my asp.net website using Twitterizer API Library. Please see below code

TwitterStatus.Update(tokens, "Message");





使用此方法我只能发送短信但是,我想发送带有小图片的短信。



是否可以使用Twitterizer发送带有短信的小图片?



请帮助我。



谢谢!



Using this methode i can send only text message But, I want to send text message with small image.

is it possible to send small image with text message using Twitterizer ?

Please help me.

Thanks!

推荐答案

#region发布推文与图片

byte [ ] photo = File.ReadAllBytes(@C:\ Users \Public\Pictures \Sample Pictures\Koala.jpg);

TwitterResponse response = TwitterStatus.UpdateWithMedia(tokens, img,照片);

if(response.Result == RequestResult.Success)

{

Response.Write(Image Post Successfully );

}

#endregion



img是你的twit

照片是你上传的照片

代币是 - 见下文



OAuthTokens代币=新OAuthTokens();

tokens.ConsumerKey = oauth_consumer_key;

tokens.ConsumerSecret = oauth_consumer_secret;

tokens.AccessToken = oauth_token;

tokens.AccessTokenSecret = oauth_token_secret;
#region Post Tweets with Image
byte[] photo = File.ReadAllBytes(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg");
TwitterResponse response = TwitterStatus.UpdateWithMedia(tokens, "img", photo);
if (response.Result == RequestResult.Success)
{
Response.Write(" Image Post Successfully");
}
#endregion

img is your twit
photo is your uploaded photo
tokens is -- see below

OAuthTokens tokens = new OAuthTokens();
tokens.ConsumerKey = oauth_consumer_key;
tokens.ConsumerSecret = oauth_consumer_secret;
tokens.AccessToken = oauth_token;
tokens.AccessTokenSecret = oauth_token_secret;


这篇关于如何使用来自ASP.NET站点的Twitterizer API在Twitter上发布带有小图像的twit ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆