تحقق من كلمة المرور للملفات المشفرة
Contents
[
Hide
]
إذا تم تأمين ملفات Excel (xlsx و xlsb و xls و xlsm) و Open office (ODS) بكلمة مرور ، فإن Aspose يدعم التحقق البسيط من كلمة المرور بدون تحليل بيانات معينة للملفات.
تحقق من كلمة مرور الملف المشفر
للتحقق من كلمة المرور الخاصة بالملف المشفر ، يوفر Aspose.Cells for .NET الامتداداكد كلمة المرور طريقة. تقبل هذه الطرق معلمتين ، دفق الملف وكلمة المرور التي يجب التحقق منها. يوضح مقتطف الشفرة التالي استخدام ملفاكد كلمة المرور طريقة للتحقق مما إذا كانت كلمة المرور المقدمة صالحة أم لا.
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 | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create a Stream object | |
FileStream fstream = new FileStream(dataDir + "EncryptedBook1.xlsx", FileMode.Open); | |
bool isPasswordValid = FileFormatUtil.VerifyPassword(fstream, "1234"); | |
Console.WriteLine("Password is Valid: " + isPasswordValid); |