Crittografare e decrittografare i file ODS

Crittografare con OpenOffice Calc

  1. SelezionareSalva come e fare clic suSalva con password scatola.
  2. Clicca ilSalva pulsante.
  3. Digita la password desiderata in entrambi i fileInserisci la password per aprire eConferma password campi nella finestra Imposta password che si apre.
  4. 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.

// 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.

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