检测加密的Office Open XML OOXML文件的文件格式
Contents
[
Hide
]
Office Open XML(也称为OOXML或Microsoft Open XML(MOX))是由Microsoft开发的用于表示办公文档的基于XML的文件格式,如电子表格、图表、演示文稿和文字处理文档。
Aspose.Cells提供了一种检测加密的Microsoft Open XML文件格式的方法。要识别文件类型,请使用FileFormatUtil.DetectFileFormat方法,如下面的代码示例所示。
This file contains 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Source directory | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
var filename = sourceDir + "encryptedBook1.out.tmp"; | |
Stream stream = File.Open(filename, FileMode.Open); | |
FileFormatInfo fileFormatInfo = FileFormatUtil.DetectFileFormat(stream, "1234"); // The password is 1234 | |
Console.WriteLine("File Format: " + fileFormatInfo.FileFormatType); |