Pergunta

I’m using SharpSVN.

I have to delete the SVN authentication credentials stored in the PC.

I try with

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

it delete credential for the during of program, but it doesn't delete the credentials data stored in the computer.

Someone now how to do it?

Thanks!!

Foi útil?

Solução

The solution I have found is:

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();    
    }

}  

This solution delete all SVN credentials data stored.

The svnAuthenticationCacheItem has a lot of information about credential stored in computer.

I found idea for the solution here: http://sharpsvn.open.collab.net/ds/viewMessage.do?dsForumId=728&viewType=browseAll&dsMessageId=319851

I hope this could help someone

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top