Encrypt

ProtectionManager.Encrypt method

使用指定密码加密演示文稿。

public void Encrypt(string encryptionPassword)
参数类型描述
encryptionPasswordString密码。

示例

以下示例代码演示了如何加密 PowerPoint 演示文稿。

[C#]
using (Presentation presentation = new Presentation("pres.pptx"))
{
    presentation.ProtectionManager.Encrypt("123123");
    presentation.Save("encrypted-pres.pptx", SaveFormat.Pptx);
}

参见