使用 C++ 解锁 PPT

使用 Aspose.Slides for C++ 移除演示文稿文件的加密和写保护,无需 Microsoft PowerPoint。

通过 C++ 移除 PPT 演示文稿的保护

Aspose.Slides for C++ 可以移除 PPT 演示文稿的加密或写保护。使用 LoadOptions 打开加密文件,然后使用 Presentation 类中的 ProtectionManager 对象调用 RemoveEncryption 或 RemoveWriteProtection。

使用 C++ 移除 PPT 的密码保护

auto loadOptions = MakeObject<LoadOptions>();
loadOptions->set_Password(u"password");

auto presentation = MakeObject<Presentation>(u"encrypted-presentation.ppt", loadOptions);

presentation->get_ProtectionManager()->RemoveEncryption();
presentation->Save(u"unlocked-presentation.ppt", SaveFormat::Ppt);
presentation->Dispose();

使用 C++ 移除 PPT 演示文稿的写保护

auto presentation = MakeObject<Presentation>(u"write-protected-presentation.ppt");

presentation->get_ProtectionManager()->RemoveWriteProtection();
presentation->Save(u"unlocked-write-protected-presentation.ppt", SaveFormat::Ppt);
presentation->Dispose();

如何通过 C++ 移除 PPT 的密码

按照以下步骤移除 PPT 演示文稿的保护。

  1. 使用 Presentation 类加载 PPT 文件,需要密码时同时使用 LoadOptions。
  2. 使用 ProtectionManager 对象移除保护。
  3. 对加密文件调用 RemoveEncryption,对写保护文件调用 RemoveWriteProtection。
  4. 使用 SaveFormat::Ppt 保存解锁后的文件。

基于 Aspose.Slides 构建

在线解锁 PPT 文件

免费的 Aspose.Slides Unlock 应用基于 Aspose.Slides for C++ 构建,与上方代码使用的是同一 API。打开它,看看 API 能如何处理您自己的 PPT 文件。

  • 在浏览器中运行,无需安装任何软件。
  • 在编写代码之前,先了解 Aspose.Slides 如何移除保护。
  • 移除 PPT 文件的密码或写保护。
  • 下载解锁后的文件。

其他支持解锁的格式

使用 C++,您还可以移除以下格式的保护。