[英]Windows Forms application C# | Sending Tweet
更新:我仍然沒有解決它,我目前的解決方法是不做桌面客戶端。 我現在已切換回Web應用程序,並且一切正常。 我不知道,我很困惑。
我已經能夠使Twitter Web應用程序正常運行,但是最近我決定從Windows窗體中添加Tweeting功能,但是我沒有運氣發送Tweet。 沒有引發任何錯誤。 介意查看我的代碼嗎?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TweetSharp;
namespace TwitterAdvirtiser
{
public partial class Form1 : Form
{
private string cKey = "xxx";
private string cSecret = "xxx";
private string oToken = "xxx";
private string aToken = "xxx";
public Form1()
{
InitializeComponent();
OnStart();
}
private void OnStart()
{
//Authenticate with Twitter
TwitterService service = new TwitterService(cKey, cSecret);
service.AuthenticateWith(oToken, aToken);
service.SendTweet("testing");
}
}
}
似乎我正在進行身份驗證就可以了,我可以遍歷調試模式,並在TwitterUser結構中查看我的所有詳細信息,但是我的推文從未顯示在我的feed上。 這是怎么回事?
順便說一句,我正在使用Visual Studios 2010和.NET 4.0。 我已驗證oToken和aToken字符串具有我的開發人員令牌。
據我所知,您僅使用Consumer Key,Consumer Secret,Token Token和Token Secret進行身份驗證。 您還需要將驗證器引腳包括在簽名庫中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.