暗号化されたOffice Open XMLファイルのファイル形式を検出する
Contents
[
Hide
]
Office Open XML (またはOOXML、Microsoft Open XML(MOX)としても知られる)は、Microsoftによって開発されたXMLベースのファイル形式で、スプレッドシート、チャート、プレゼンテーション、ワード処理などのオフィスドキュメントを表現するために使用されます。
Aspose.Cells for Python via .NETは、暗号化されたMicrosoft Open XMLファイルのフォーマットを検出する方法を提供します。ファイルタイプを識別するには、次の例のようにFileFormatUtil.detect_file_formatメソッドを使用します。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |