Crittografa e decritta i file ODS

Crittografa con OpenOffice Calc

  1. Seleziona Salva con nome e seleziona la casella Salva con password.
  2. Fai clic sul pulsante Salva.
  3. Digita la password desiderata nei campi Inserisci password per aprire e Conferma password nella finestra Imposta password che si apre.
  4. Fare clic sul pulsante OK per salvare il file.

Cifra il file ODS con Aspose.Cells per .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.

// 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");

Decifra il file ODS con Aspose.Cells per .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.

// 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");