Error code 215 bad authentication data


#1

hello, im trying to create an application using c# that tweets and posts pictures and it used to work fine.
i dont know if its because of the new API that it stopped working and also im not an experienced programmer so if anyone can help me figure out how to solve the problem it would be great!

here’s my code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using TweetSharp;
using Hammock;

namespace TweetNow
{
class TweetManager
{

static public TwitterService initiate()
{
String _consumerKey = “consumer Key”;
String _consumerSecret = “Consumer Secret”;

String _accessToken = “access token”;
String _accessTokenSecret = “access token secret”;
// Pass your credentials to the service
TwitterService service = new TwitterService(_consumerKey, _consumerSecret);

// Retrieve an OAuth Request Token
service.AuthenticateWith(_accessToken, _accessTokenSecret);

return service;

}

public static void sendTweet(String msg,String picname,TwitterService serv) {

RestRequest request = serv.PrepareEchoRequest();
request.Path = “uploadAndPost.xml”;
request.AddFile(“media”, “smile”, “Images/”+picname, “image/jpeg”);

//request.AddField(“key”, “*****");
request.AddField(“key”, "
”);
request.AddField(“message”, “Emote with a Pic!”);

RestClient client = new RestClient { Authority = “http://api.twitpic.com/”, VersionPath = “2” };
RestResponse response = client.Request(request);
Console.WriteLine(response.Content);

String str = response.Content;
int first = str.IndexOf("");
int last = str.LastIndexOf("");
string str2 = str.Substring(first + 5, last - first - 5);

serv.SendTweet(msg+" “+str2+” .");
}
}
}