CheckWriteProtection()

IPresentationInfo::CheckWriteProtection(System::String) method

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

virtual bool Aspose::Slides::IPresentationInfo::CheckWriteProtection(System::String password)=0

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 IPresentationInfo::get_IsWriteProtected property before calling this method.
  2. When password is null or empty, this method returns false.

See Also