Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从我的ASP.NET页面更新twitter状态_C#_Asp.net_Twitter - Fatal编程技术网

C# 如何从我的ASP.NET页面更新twitter状态

C# 如何从我的ASP.NET页面更新twitter状态,c#,asp.net,twitter,C#,Asp.net,Twitter,我正在尝试从asp.net网页更新我的状态 下面是我的代码;但它并没有更新。 请检查我的代码并回复 protected void btnTwitt_Click(object sender, EventArgs e) { string twitterMsg = txtShout.Text; OAuthTokens tokens = new OAuthTokens(); tokens.AccessToken = "My Access Token"; tokens.Ac

我正在尝试从asp.net网页更新我的状态

下面是我的代码;但它并没有更新。 请检查我的代码并回复

protected void btnTwitt_Click(object sender, EventArgs e)
{
    string twitterMsg = txtShout.Text;
    OAuthTokens tokens = new OAuthTokens();
    tokens.AccessToken = "My Access Token";
    tokens.AccessTokenSecret = "My Access Token Secret here";
    tokens.ConsumerKey = "My Consumer Key";
    tokens.ConsumerSecret = "My Consumer Secrete here";
    TwitterResponse<Twitterizer.TwitterStatus> tweetResponse = 
        Twitterizer.TwitterStatus.Update(tokens, twitterMsg);
    lblTwitMsg.Text = "Your have shout successfully on http://twitter.com/" + "";
}
protectedvoid btnTwitt_单击(对象发送方,事件参数e)
{
字符串twitterMsg=txtShout.Text;
OAuthTokens tokens=新的OAuthTokens();
tokens.AccessToken=“我的访问令牌”;
tokens.AccessTokenSecret=“此处为我的访问令牌密码”;
tokens.ConsumerKey=“我的消费者密钥”;
tokens.ConsumerSecret=“我的消费者在此保密”;
TwitterResponse tweetResponse=
Twitterizer.TwitterStatus.Update(令牌,twitterMsg);
lblTwitMsg.Text=“您的手机已成功开机http://twitter.com/" + "";
}

下面的代码对我很有用:

protected void Tweet_Click(object sender, ImageClickEventArgs e)
{

    string Twet = txtTweet.InnerText;
    ViewState["twe"] = Twet.ToString();
    string Twttxt = ViewState["twe"].ToString();



    OAuthTokens a = new OAuthTokens();
    a.ConsumerSecret = consumerSecret;
    a.ConsumerKey = consumerKey;
    a.AccessToken = ViewState[" AccessKey "].ToString();
    a.AccessTokenSecret = ViewState["  AccessSecrt"].ToString();

    TwitterResponse<TwitterStatus> tweet = TwitterStatus.Update(a, "" + Twttxt + "");


    txtTweet.Value = "";
    DataList1.Visible = true;
    string nm = ViewState[" Twitter_id"].ToString();
    TimeLineLoad(nm);//function used to fill my tweets in datalist


}
protectedvoid Tweet\u单击(对象发送者,ImageClickEventArgs e)
{
字符串Twet=txtweet.InnerText;
ViewState[“twe”]=Twet.ToString();
字符串Twttxt=ViewState[“twe”].ToString();
OAuthTokens a=新的OAuthTokens();
a、 ConsumerCret=ConsumerCret;
a、 消费市场=消费市场;
a、 AccessToken=ViewState[“AccessKey”].ToString();
a、 AccessTokenSecret=ViewState[“AccessSecrt”].ToString();
TwitterResponse tweet=TwitterStatus.Update(a,“+TwtText+”);
txtweet.Value=“”;
DataList1.Visible=true;
字符串nm=ViewState[“Twitter_id”].ToString();
TimeLineLoad(nm);//用于在数据列表中填充我的推文的函数
}

我在给定行上遇到错误

TwitterResponse tweet=TwitterStatus.Update(a,“+TwtText+”)


错误3找不到类型或命名空间名称“TwitterResponse”(是否缺少using指令或程序集引用?

检查,注意-这是我的博客文章-检查此代码是否不完整。该错误可能与获取令牌信息(accesstoken和secret)有关。