【问题标题】:Posting a tweet C#发布推文 C#
【发布时间】:2014-07-16 08:02:38
【问题描述】:
我正在尝试使用 TweetSharp 库发布推文,但抛出了 StackOverflowException。我无法解决这个问题。我该怎么办?错误出现在这一行:
servis.SendTweet(new SendTweetOptions { Status = textBox1.Text });
【问题讨论】:
标签:
c#
twitter
stack-overflow
tweetsharp
【解决方案1】:
将其分解并在调试器中单步执行(在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);