CheckWriteProtection

IProtectionManager.CheckWriteProtection 方法

确定演示文稿是否受密码保护以进行修改。

public bool CheckWriteProtection(string password)
参数类型描述
passwordString用于检查的密码。

返回值

如果密码有效,则为 True;否则为 false。

备注

  1. 在调用此方法之前,应检查 IsWriteProtected 属性。 2. 当密码为 null 或空时,此方法返回 false。

示例

[C#]
using (var presentation = new Presentation(presentationFilePath))
{
    var isWriteProtected = presentation.ProtectionManager.CheckWriteProtection("my_password");
}

另请参阅