الكشف عن تنسيق الملف لملفات Office Open XML المُشفرة
Contents
[
Hide
]
ملفات Office Open XML (المعروفة أيضًا بـ OOXML أو Microsoft Open XML (MOX)) هي تنسيق ملفات مستند XML المعتمد من Microsoft لتمثيل المستندات الإدارية مثل جداول البيانات والرسوم البيانية والعروض التقديمية ومستندات معالجة النصوص.
يوفر 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); |