CheckPassword

PresentationInfo.CheckPassword 方法

检查用于保护打开密码的演示文稿的密码是否正确。

public bool CheckPassword(string password)
参数类型描述
passwordString要检查的密码。

返回值

如果演示文稿是使用打开密码保护的,并且密码正确,则返回 true;否则返回 false。

异常

异常条件
InvalidOperationException
NotSupportedException

备注

当密码为 null 或为空时,该方法返回 false。

示例

[C#]
IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo(presentationFilePath);
bool isPasswordCorrect = info.CheckPassword("my_password");

另见