开发者

Windows Forms application C# | Sending Tweet

开发者 https://www.devze.com 2023-02-03 18:36 出处:网络
UPDATE: I still haven\'t solved it, my my current work around is to not do a desktop client. I\'ve switched back to a web app for now, and everything is working again. I don\'t know, I\'m stumped.

UPDATE: I still haven't solved it, my my current work around is to not do a desktop client. I've switched back to a web app for now, and everything is working again. I don't know, I'm stumped.

I've been able to get my Twitter web app working just fine, but I've recently decided to add Tweeting functionality from a Windows Form, but I'm having no luck sending tweets. No errors are thrown or anything. Mind looking over my code?

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 Tw开发者_运维问答eetSharp;

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");
        }
    }
}

It seems like I'm authenticating just fine, I can walk through debug mode and see all my details in the TwitterUser structure, and yet my tweets never show up on my feed. Whats up?

By the way, I'm using Visual Studios 2010, and .NET 4.0. I have verified that the oToken and aToken strings have my developer tokens.


As far as I can see you're only authenticating using the Consumer Key, Consumer Secret, Token Key and Token Secret. You also need to include the verifier pin with the signature base.

0

精彩评论

暂无评论...
验证码 换一张
取 消