Linq2Twitter身份验证问题

时间:2015-02-23 15:49:35

标签: c# linq-to-twitter

我对Linq2Twitter很新。样品也不多。我拿了一个使用Linq2Twitter制作的现有应用程序并逐字使用它的代码(显然除了配置中的键)。每当它到达AuthorizeAsync()时,它都会失败:

var auth = PerformAuthorization();

        try
        {
            await auth.AuthorizeAsync();
        }
        catch (Exception ex)
        {
            MessageBox.Show("\n\nPlease make sure that:"
                            + "\n\t- your computer's date/time is accurate;"
                            + "\n\t- you entered the exact PIN returned by Twitter."
                            + "\n\n\nTwitter error message: " + ex.Message,
                            "Twitter Archive Eraser");

            return;
        }

我现在该如何解决?

1 个答案:

答案 0 :(得分:1)

听起来您可能正在接收HTTP 401 Unauthorized错误,该错误表现为异常。您可以查看异常实例的详细信息,以了解有关特定问题的更多信息。 LINQ to Twitter还包括异常消息中的Twitter API响应。发生401错误的原因有很多,而且我已经编写了常见问题解答以帮助您解决这个问题:

LINQ to Twitter FAQ

可下载源代码中有多种技术演示:

LINQ to Twitter Demos

控制台演示有一个所有API调用的示例。该文档还包含每个API调用的示例:

LINQ to Twitter Documentation