暗号化されたOffice Open XMLファイルのファイル形式を検出する

Contents
[ ]

Aspose.Cells for Python via .NETは、暗号化されたMicrosoft Open XMLファイルのフォーマットを検出する方法を提供します。ファイルタイプを識別するには、次の例のようにFileFormatUtil.detect_file_formatメソッドを使用します。

from aspose.cells import FileFormatUtil
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Source directory
sourceDir = RunExamples.Get_SourceDirectory()
filename = sourceDir + "encryptedBook1.out.tmp"
stream = open(filename, "rb")
fileFormatInfo = FileFormatUtil.detect_file_format(stream, "1234")
print("File Format: " + str(fileFormatInfo.file_format_type))