Igo*_*ros 1 twitter windows-phone-7
我试图用一种简单的方法将推文发布到推特上,仅此而已.我找不到一个体面的教程或与此相关的文档...它有10个库,无法弄清楚如何使用它们,甚至不想打扰它说实话我JUST WANNA POST ...这就是我的目标,但仍然无法正常工作:
private void TweetBtn_Click(object sender, RoutedEventArgs e)
{
// Create a webclient with the twitter account credentials,which will be used to set the HTTP header or basic authentication
client = new WebClient { Credentials = new NetworkCredential { UserName = usernameTxtBox.Text, Password = password.Password } };
// Don't wait to receive a 100 Continue HTTP response from the server before sending out the message body
//ServicePointManager.Expect100Continue = false;
// Construct the message body
byte[] messageBody = Encoding.UTF8.GetBytes("status=" + messageTxtBox.Text);
// Send the HTTP headers and message body (a.k.a. Post the data)
client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadStringCompleted);
client.UploadStringAsync(new Uri("http://twitter.com/statuses/update.xml", UriKind.Absolute), messageTxtBox.Text);
}
Run Code Online (Sandbox Code Playgroud)
提前致谢 :)
| 归档时间: |
|
| 查看次数: |
712 次 |
| 最近记录: |