ODS-Dateien verschlüsseln und entschlüsseln
Contents
[
Hide
]
OpenOffice.org ist eine Office-Suite mit vollem Funktionsumfang, die den Passwortschutz und die Verschlüsselung von Dateien unterstützt. Die verschlüsselte ODS-Datei kann jedoch nur von OpenOffice geöffnet werden, nachdem das Kennwort angegeben wurde. Excel kann die verschlüsselte ODS-Datei nicht öffnen und gibt möglicherweise eine Warnmeldung aus. Die Verschlüsselungsoptionen gelten im Gegensatz zu anderen Dateitypen nicht für die ODS-Datei.
Aspose.Cells ermöglicht das Verschlüsseln und Entschlüsseln der Datei ODS. Die entschlüsselte ODS-Datei kann sowohl in Excel als auch in OpenOffice geöffnet werden,
Verschlüsseln mit OpenOffice Calc
- WählenSpeichern als und Klicken Sie auf dieMit Passwort speichern Kasten.
- Drücke denSpeichern Knopf.
- Geben Sie Ihr gewünschtes Passwort in beide einGeben Sie das Passwort zum Öffnen ein undKennwort bestätigen Felder im sich öffnenden Fenster Passwort festlegen.
- Drücke denOK Schaltfläche, um die Datei zu speichern.
ODS-Datei mit Aspose.Cells für .Net verschlüsseln
Um eine ODS-Datei zu verschlüsseln, laden Sie die Datei und stellen Sie dieWorkbookSettings.Password Wert auf das eigentliche Passwort, bevor Sie es speichern. Die verschlüsselte Ausgabedatei ODS kann nur in OpenOffice geöffnet werden.
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"); |
Entschlüsseln Sie die ODS-Datei mit Aspose.Cells für .Net
Um eine ODS-Datei zu entschlüsseln, laden Sie die Datei, indem Sie ein Passwort in derLoadOptions.Passwort . Sobald die Datei geladen ist, legen Sie dieWorkbookSettings.Password Zeichenfolge auf 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"); |