Определить формат файла зашифрованного 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);