使用SharpSVN删除本地SVN身份验证凭据

时间:2013-06-13 19:36:17

标签: c# svn authentication sharpsvn

我正在使用SharpSVN。

我必须删除存储在PC中的SVN身份验证凭据。

我尝试

using (SvnClient client = new SvnClient())
{
    // Clear predefined handlers and previous authentication
    client.Authentication.Clear();
}

删除程序期间的凭据,但不会删除存储在计算机中的凭据数据

现在有人怎么做?

谢谢!

1 个答案:

答案 0 :(得分:2)

我找到的解决方案是:

using (SvnClient client = new SvnClient())

{

    //delete all Svn Authentication credential stored in the computer    
    foreach (var svnAuthenticationCacheItem in client.Authentication.GetCachedItems(SvnAuthenticationCacheType.UserNamePassword))    
    {   
        svnAuthenticationCacheItem.Delete();    
    }

}  

此解决方案删除所有存储的SVN凭据

svnAuthenticationCacheItem有很多关于存储在计算机中的凭据的信息。

我在这里找到了解决方案的想法: http://sharpsvn.open.collab.net/ds/viewMessage.do?dsForumId=728&viewType=browseAll&dsMessageId=319851

我希望这可以帮助某人

相关问题