Currently I am using TweetSharp DLL in my project for posting tweets on Twitter with simple text. Now, I want to post a tweet with an image...
I am using this..
Hdn_FullPath.Value = "http://www.domain_name.com/images/Twitter/2015/2/user_icon.png";
#region "Tweet on Twitter"
var service = new TwitterService(DbConnect.ConsumerKey, DbConnect.ConsumerSecret);
service.AuthenticateWith(DbConnect.Token, DbConnect.TokenSecret);
TwitterStatus result;
string URL_str = Hdn_FullPath.Value;
using (var stream = new FileStream(URL_str, FileMode.Open))
{
result = service.SendTweetWithMedia(new SendTweetWithMediaOptions
{
Status = txtTweetDetails.Text.Trim(),
Images = new Dictionary<string, Stream> { { URL_str, stream } }
});
};
if (result == null)
throw new NotImplementedException();
#endregion
But in this case, it will return an error at line 48 -
URI formats are not supported.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: URI formats are not supported.
Line 46: string URL_str = Hdn_FullPath.Value;
Line 47:
Line 48: using (var stream = new FileStream(URL_str, FileMode.Open))
Line 49: {
Line 50: result = service.SendTweetWithMedia(new SendTweetWithMediaOptions