Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# %使用Tweetsharp在Twitter帖子中签名会导致未经授权_C#_Tweetsharp - Fatal编程技术网

C# %使用Tweetsharp在Twitter帖子中签名会导致未经授权

C# %使用Tweetsharp在Twitter帖子中签名会导致未经授权,c#,tweetsharp,C#,Tweetsharp,我有一段简单的代码,可以发送Tweet。在邮件中保留%符号会导致错误: class Program { static void Main(string[] args) { var test = new TwitterService("ConsumerKey", "ConsumerSecret", "Token", "TokenSecret"); try { // "Test 1, So, I know th

我有一段简单的代码,可以发送Tweet。在邮件中保留%符号会导致错误:

class Program
{
    static void Main(string[] args)
    {
        var test = new TwitterService("ConsumerKey", "ConsumerSecret", "Token", "TokenSecret");

        try
        {
            // "Test 1, So, I know there's no #inflation and so on...but the 10y inflation swap just went to 2.80%. 5y CPI 5y forward is 3.15%. Hmmm."
            test.SendTweet(WebUtility.HtmlEncode("Test 3, So, I know there's no #inflation and so on...but the 10y inflation swap just went to 2.80%. 5y CPI 5y forward is 3.15. Hmmm."));
        }
        catch (Exception ex)
        {
            if (ex.Message.Equals(""))
            {

            }
        }
    }
}

如果我通过TweetDeck或直接使用Twitter页面发送相同的消息,那么它会毫无问题地发布。有什么想法吗?

看起来你必须使用
&37
而不是常规的%符号。

听起来您需要在发送信息之前对其进行HTML编码。已尝试WebUtility.HtmlEncode,无更改。@Rob-更新代码以反映您的尝试。