重新验证evernote应用程序C#

时间:2016-07-22 01:26:27

标签: c# windows api evernote

我第一次使用evernote对应用程序进行身份验证时,我看到了evernote登录页面,我可以在其中验证我的应用程序。撤消访问后,我无法访问上传笔记或获取笔记本列表等功能。我怎么能强迫叛徒。过程再次发生? I.E在应用启动时再次显示evernote登录屏幕。这是我在form.load()中的代码:

// Be sure to put your own consumer key and consumer secret here.
ENSession.SetSharedSessionConsumerKey("your key", "your secret");

if (ENSession.SharedSession.IsAuthenticated == false)
{
    ENSession.SharedSession.AuthenticateToEvernote();
}

运行时我没有收到任何错误,但是当我尝试上传笔记时出现此错误:

Evernote.EDAM.Error.EDAMNotFoundException

感谢任何帮助,谢谢!

3 个答案:

答案 0 :(得分:0)

查看http://codepen.io/tacoxlegendary/pen/VjXqkA?editors=1100,您似乎可以将ENSession.SharedSession.IsAuthenticated设置为false,然后调用ENSession.SharedSession.AuthenticateToEvernote()。试一试,看看它是否有效?

答案 1 :(得分:0)

我没试过这个,但看起来你可以打电话了

does not

然后检查

ENSession.SharedSession.PerformPostAuthentication();

如果评估为false,则循环回调用

ENSession.SharedSession.IsAuthenticated.

答案 2 :(得分:0)

我知道这是一个老线程,但我偶然发现它正在寻找相关的东西。

使用ENSession或ENSession高级版的Evernote SDK似乎没有提供去验证的方法。然而,在对其dll进行反编译之后,我注意到实际上存在一个私有的Unauthenticate方法。所以理论上你可以使用反射,所以调用这个方法:

$(document).ready(function() {

            $('#button').click(function(e) {
                var inputvalue = $("#bin").val().substring(0, 6);
                // console.log(" https://bincheck.org/" + inputvalue);
                window.location.replace(" https://bincheck.org/" + inputvalue);
            });
        });

我确信Evernote之所以将其设为私有,所以我会小心地调用它,但这应该可以解决问题。我在我的一个测试应用程序中尝试了这个并且在调用Unauthenticate之后我验证了ENSession.SharedSession.IsAuthenticated是假的并且调用ENSessionAdvanced.SharedSession.AuthenticateToEvernote()确实启动了一个Web浏览器,要求您登录Evernote。