Crittografa e decritta i file ODS
Crittografa con OpenOffice Calc
- Seleziona Salva con nome e seleziona la casella Salva con password.
- Fai clic sul pulsante Salva.
- Digita la password desiderata nei campi Inserisci password per aprire e Conferma password nella finestra Imposta password che si apre.
- Fare clic sul pulsante OK per salvare il file.
Crittografa il file ODS con Aspose.Cells per Python via .NET
Per cifrare un file ODS, caricare il file e impostare il valore WorkbookSettings.password alla password effettiva prima di salvarlo. Il file ODS cifrato risultante può essere aperto solo con OpenOffice.
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
sourceDir = RunExamples.Get_SourceDirectory() | |
# Output directory | |
outputDir = RunExamples.Get_OutputDirectory() | |
# Open an ODS file | |
workbook = Workbook(sourceDir + "sampleODSFile.ods") | |
# Password protect the file | |
workbook.settings.password = "1234" | |
# Save the ODS file | |
workbook.save(outputDir + "outputEncryptedODSFile.ods") |
Decrittografa il file ODS con Aspose.Cells per Python via .NET
Per decifrare un file ODS, caricare il file fornendo una password in LoadOptions.password. Una volta caricato il file, impostare la stringa WorkbookSettings.password su null.
from aspose.cells import LoadFormat, LoadOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
sourceDir = RunExamples.Get_SourceDirectory() | |
# Output directory | |
outputDir = RunExamples.Get_OutputDirectory() | |
# Open an encrypted ODS file | |
loadOptions = LoadOptions(LoadFormat.ODS) | |
# Set original password | |
loadOptions.password = "1234" | |
# Load the encrypted ODS file with the appropriate load options | |
workbook = Workbook(sourceDir + "sampleEncryptedODSFile.ods", loadOptions) | |
# Set the password to null | |
workbook.settings.password = None | |
# Save the decrypted ODS file | |
workbook.save(outputDir + "outputDecryptedODSFile.ods") |