/// <summary> /// Remove stored credentials from windows credential store /// </summary> /// <param name="Target">Name of the application/Url where the credential is used for</param> /// <returns>True: Success, False: Failure</returns> public static bool RemoveCredentials(string Target) { try { // Make the API call using the P/Invoke signature return NativeCode.CredDelete(Target, NativeCode.CredentialType.Generic, 0); } catch (Exception e) { log.error($"Could not remove credentials {Target}", e); return false; } }
/// <summary> /// Remove stored credentials from windows credential store /// </summary> /// <param name="Target">Name of the application/Url where the credential is used for</param> /// <returns>True: Success, False: Failure</returns> public static bool RemoveCredentials(string Target) { // Make the API call using the P/Invoke signature return(NativeCode.CredDelete(Target, NativeCode.CredentialType.Generic, 0)); }