Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: The remote server return an error :(401) Unauthorized

$
0
0
I am a beginner to use this api.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tweetinvi;
namespace Twitter
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        TwitterCredentials.SetCredentials("xxxxxxx", "xxxxx", "xxxxxx", "xxxxxx");  
        TwitterCredentials.ApplicationCredentials = TwitterCredentials.CreateCredentials("xxxxx", "xxxxxx", "xxxxx", "xxxxxx");

    }

    private void button1_Click(object sender, EventArgs e)
    {
            var tweet = Tweet.PublishTweet("C# API Test");       
    }
}
}


This simple code not give any error but its not also post my tweet...
and when i debug the code then it will give like following....

Exception
The remote server return an error :(401) Unauthorized

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>