CheckWriteProtection()

PresentationInfo::CheckWriteProtection(System::String) method

Checks whether a password to modify is correct for a write protected presentation.

bool Aspose::Slides::PresentationInfo::CheckWriteProtection(System::String password) override

Arguments

ParameterTypeDescription
passwordSystem::StringThe password to check.

Return Value

True if the presentation is write protected and the password is correct. False otherwise.

Remarks

auto info = PresentationFactory::get_Instance()->GetPresentationInfo(presentationFilePath);
if (info->get_IsWriteProtected() == Aspose::Slides::NullableBool::True)
{
    bool isWriteProtectedByPassword = info->CheckWriteProtection(u"my_password");
}
  1. You should check the PresentationInfo::get_IsWriteProtected property before calling this method.
  2. When password is null or empty, this method returns false.

See Also