The following code shows how to check whether a file is password-protected:
// Get a file infoOptions.FileInfoinfo=Parser.GetFileInfo(filePath);// Check IsEncrypted propertyConsole.WriteLine(info.IsEncrypted?"Password is required":"");
The following code shows how to check a file type of the password-protected document:
// Get a file infoOptions.FileInfoinfo=Parser.GetFileInfo(filePath,newLoadOptions("password"));// Check IsEncrypted propertyConsole.WriteLine(info.IsEncrypted?"Password is required":"");// Print the file typeConsole.WriteLine(info.FileType.ToString());
The following code shows how to check whether a file is password-protected:
// Get a file infoOptions.FileInfoinfo=Parser.GetFileInfo(document);// Check IsEncrypted propertyConsole.WriteLine(info.IsEncrypted?"Password is required":"");
The following code shows how to check a file type of the password-protected document:
// Get a file infoOptions.FileInfoinfo=Parser.GetFileInfo(document);// Check IsEncrypted propertyConsole.WriteLine(info.IsEncrypted?"Password is required":"");// Print the file typeConsole.WriteLine(info.FileType.ToString());