ODS ファイルの暗号化と復号化
Contents
[
Hide
]
OpenOffice.org は、パスワード保護とファイルの暗号化をサポートするフル機能のオフィス スイートです。ただし、暗号化された ODS ファイルは、パスワードを入力した後にのみ OpenOffice で開くことができます。 Excel は暗号化された ODS ファイルを開くことができず、警告メッセージが表示される場合があります。暗号化オプションは、他のファイル タイプとは異なり、ODS ファイルには適用されません。
Aspose.Cells は、ODS ファイルの暗号化と復号化を許可します。復号化された ODS ファイルは、Excel と OpenOffice の両方で開くことができます。
OpenOffice Calc で暗号化する
- 選択する名前を付けて保存をクリックし、パスワード付きで保存箱。
- クリックセーブボタン。
- 必要なパスワードを両方に入力しますパスワードを入力して開くとパスワードを認証する表示される [パスワードの設定] ウィンドウのフィールド。
- クリックわかったボタンをクリックしてファイルを保存します。
.Net の Aspose.Cells で ODS ファイルを暗号化する
ODS ファイルを暗号化するには、ファイルをロードしてWorkbookSettings.Password値を実際のパスワードに変更してから保存してください。出力の暗号化された ODS ファイルは、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"); |
.Net の Aspose.Cells で ODS ファイルを復号化します。
ODS ファイルを復号化するには、LoadOptions.Password .ファイルがロードされたら、WorkbookSettings.Password文字列を 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"); |