发贴推文C#

时间:2014-07-16 08:02:38

标签: c# twitter stack-overflow tweetsharp

我正在尝试使用TweetSharp库发布推文,但会抛出StackOverflowException。我无法解决这个问题。我该怎么办?此行中出现错误:

servis.SendTweet(new SendTweetOptions { Status = textBox1.Text }); 

1 个答案:

答案 0 :(得分:2)

将其分解并在调试器中逐步执行(在string status = ...行放置一个断点):

// if you don't get this far, the problem is elsewhere

// if it fails here, the problem is accessing the textbox value
string status = textBox1.Text;

// if it fails here, the problem is inside the tweetsharp library,
// and should be referred to the library authors, but indicating which
// step fails (constructor vs Status property vs Send method)
var msg = new SendTweetOptions();
msg.Status = status;
servis.SendTweet(msg);