Aspose.Email.Examples.CSharp.Email.Outlook.CheckPasswordProtection.IsPasswordProtected C# (CSharp) Метод

IsPasswordProtected() приватный статический Метод

Determines whether the specified PST is password protected.
private static IsPasswordProtected ( PersonalStorage pst ) : bool
pst PersonalStorage
Результат bool
        private static bool IsPasswordProtected(PersonalStorage pst)
        {
            // ExStart:CheckPasswordProtection-IsPasswordProtected
            // If the property exists and is nonzero, then the PST file is password protected.
            if (pst.Store.Properties.Contains(MapiPropertyTag.PR_PST_PASSWORD))
            {
                long passwordHash = pst.Store.Properties[MapiPropertyTag.PR_PST_PASSWORD].GetLong();
                return passwordHash != 0;
            }
            return false;
            // ExEnd:CheckPasswordProtection-IsPasswordProtected
        }     
    }
CheckPasswordProtection