更新:我还没有解决它,我目前的工作是不做桌面客户端。我现在已经切换回网络应用程序,一切都恢复正常了。我不知道,我被难住了。
我已经能够让我的 Twitter Web 应用程序正常工作,但我最近决定从 Windows 窗体添加 Tweeting 功能,但我发送推文没有运气。没有错误被抛出或任何东西。介意查看我的代码吗?
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 结构中查看我的所有详细信息,但我的推文从未出现在我的提要中。这是怎么回事?
顺便说一句,我使用的是 Visual Studios 2010 和 .NET 4.0。我已验证 oToken 和 aToken 字符串具有我的开发人员令牌。