用c#发布推文

本文关键字:布推文 | 更新日期: 2023-09-27 18:13:19

我正试图用TweetSharp库发布推文,但StackOverflowException被抛出。我解决不了这个问题。我该怎么办?错误发生在这一行:

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

用c#发布推文

将其分解并在调试器中逐步执行(在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);