Simple.CredentialManager.Credential.Delete C# (CSharp) 메소드

Delete() 공개 메소드

Deletes this instance.
Target must be specified to delete a credential.
public Delete ( ) : bool
리턴 bool
        public bool Delete()
        {
            CheckNotDisposed();
            UnmanagedCodePermission.Demand();

            if (string.IsNullOrEmpty(Target))
                throw new InvalidOperationException("Target must be specified to delete a credential.");

            StringBuilder targetToDelete = string.IsNullOrEmpty(Target)
                ? new StringBuilder()
                : new StringBuilder(Target);

            return NativeMethods.CredDelete(targetToDelete, Type, 0);
        }