4

I have a C# application that uses the rasapi32.dll to create a dial up connection. When I create such a connection under Windows 7, the credentials get stored in the credential manager as an entry called *session.

This *session entry in the credential manager causes existing connections to other resources (network shares, database connections) to become invalid. Is there a way to tell Windows not to store the credentials?

I already know a solution, but this disables storage of credentials for the whole system: Setting the registry value HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\DisableDomainCreds to 1.

I would like to disable it only for my application.

raeffs
  • 595
  • 5
  • 17

1 Answers1

0

You can just remove stored credentials Use CredDelete() from Advapi32 http://msdn.microsoft.com/en-us/library/windows/desktop/aa374787(v=vs.85).aspx There is a new managed library in Windows 8 to deal with Windows vault http://msdn.microsoft.com/library/windows/apps/windows.security.credentials.passwordvault.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

vitalygolub
  • 735
  • 3
  • 16