Crittografare e decrittografare i file ODS
Contents
[
Hide
]
OpenOffice.org è una suite per ufficio completa che supporta la protezione tramite password e la crittografia dei file. Tuttavia, il file ODS crittografato può essere aperto solo da OpenOffice dopo aver fornito la password. Excel non è in grado di aprire il file crittografato ODS e potrebbe generare un messaggio di avviso. Le opzioni di crittografia non sono applicabili per il file ODS a differenza di altri tipi di file.
Aspose.Cells consente di crittografare e decrittografare il file ODS. Il file ODS decifrato può essere aperto sia in Excel che in OpenOffice,
Crittografare con OpenOffice Calc
- SelezionareSalva come e fare clic suSalva con password scatola.
- Clicca ilSalva pulsante.
- Digita la password desiderata in entrambi i fileInserisci la password per aprire eConferma password campi nella finestra Imposta password che si apre.
- Clicca ilOK pulsante per salvare il file.
Crittografare il file ODS con Aspose.Cells per .Net
Per crittografare un file ODS, caricare il file e impostare l’estensioneImpostazioni cartella di lavoro.Password valore alla password effettiva prima di salvarla. Il file crittografato di output ODS può essere aperto solo in 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"); |
Decrittografare il file ODS con Aspose.Cells per .Net
Per decrittografare un file ODS, caricare il file fornendo una password nel fileLoadOptions.Password . Una volta caricato il file, imposta il fileImpostazioni cartella di lavoro.Password stringa a null.
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"); |