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
}
}