تشفير وفك تشفير ملفات ODS

التشفير باستخدام OpenOffice Calc

  1. حدد حفظ ك وانقر على مربع حفظ بكلمة مرور.
  2. انقر على زر حفظ.
  3. اكتب كلمة المرور المطلوبة في حقلي أدخل كلمة المرور للفتح و تأكيد كلمة المرور في نافذة تعيين كلمة المرور التي تفتح.
  4. انقر على زر موافق لحفظ الملف.

تشفير ملف ODS باستخدام Aspose.Cells لـ .Net

لتشفير ملف ODS، قم بتحميل الملف وتعيين القيمة WorkbookSettings.Password إلى كلمة المرور الفعلية قبل حفظه. يمكن فتح ملف ODS المشفر الناتج في OpenOffice فقط.

// 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 sourceDir = RunExamples.Get_SourceDirectory();
//Output directory
string outputDir = RunExamples.Get_OutputDirectory();
// Open an ODS file
Workbook workbook = new Workbook(sourceDir + "sampleODSFile.ods");
// Password protect the file
workbook.Settings.Password = "1234";
// Save the ODS file
workbook.Save(outputDir + "outputEncryptedODSFile.ods");

فك تشفير ملف ODS باستخدام Aspose.Cells لـ .Net

لفك تشفير ملف ODS، قم بتحميل الملف عن طريق تقديم كلمة مرور في LoadOptions.Password. بمجرد تحميل الملف، ضبط السلسلة WorkbookSettings.Password على القيمة الخالية.

// 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 sourceDir = RunExamples.Get_SourceDirectory();
//Output directory
string outputDir = RunExamples.Get_OutputDirectory();
// Open an encrypted ODS file
Aspose.Cells.LoadOptions loadOptions = new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Ods);
// Set original password
loadOptions.Password = "1234";
// Load the encrypted ODS file with the appropriate load options
Workbook workbook = new Workbook(sourceDir + "sampleEncryptedODSFile.ods", loadOptions);
// Set the password to null
workbook.Settings.Password = null;
// Save the decrypted ODS file
workbook.Save(outputDir + "outputDecryptedODSFile.ods");