暗号化された Office Open XML のファイル形式の検出 - OOXML ファイル

Contents
[ ]

Aspose.Cells は、暗号化されたファイル形式を検出する方法を提供しますMicrosoft オープン XMLファイル。ファイルの種類を識別するには、FileFormatUtil.DetectFileFormatコード例で以下に示すようにメソッド。

// 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);