Зашифровать и расшифровать ODS файлов
Contents
[
Hide
]
OpenOffice.org — полнофункциональный офисный пакет, поддерживающий защиту паролем и шифрование файлов. Однако зашифрованный файл ODS может быть открыт только OpenOffice после ввода пароля. Excel не может открыть зашифрованный файл ODS и может вывести предупреждающее сообщение. Параметры шифрования неприменимы к файлу ODS, в отличие от других типов файлов.
Aspose.Cells позволяет зашифровать и расшифровать файл ODS. Расшифрованный файл ODS можно открыть как в Excel, так и в OpenOffice,
Шифрование с помощью OpenOffice Calc
- ВыбиратьСохранить как и щелкнитеСохранить с паролем коробка.
- Нажмите наСохранять кнопка.
- Введите желаемый пароль в обаВведите пароль для открытия иПодтвердите пароль поля в открывшемся окне Установить пароль.
- Нажмите наХОРОШО кнопку для сохранения файла.
Зашифровать файл ODS с помощью Aspose.Cells для .Net
Для шифрования файла ODS загрузите файл и установитеWorkbookSettings.Пароль значение фактического пароля перед его сохранением. Выходной зашифрованный файл ODS можно открыть только в OpenOffice.
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 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.Пароль . После загрузки файла установитеWorkbookSettings.Пароль строку в ноль.
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 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"); |