ODS ファイルの暗号化と復号化

OpenOffice Calc で暗号化する

  1. 選択する名前を付けて保存をクリックし、パスワード付きで保存箱。
  2. クリックセーブボタン。
  3. 必要なパスワードを両方に入力しますパスワードを入力して開くパスワードを認証する表示される [パスワードの設定] ウィンドウのフィールド。
  4. クリックわかったボタンをクリックしてファイルを保存します。

.Net の Aspose.Cells で ODS ファイルを暗号化する

ODS ファイルを暗号化するには、ファイルをロードしてWorkbookSettings.Password値を実際のパスワードに変更してから保存してください。出力の暗号化された ODS ファイルは、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");

.Net の Aspose.Cells で ODS ファイルを復号化します。

ODS ファイルを復号化するには、LoadOptions.Password .ファイルがロードされたら、WorkbookSettings.Password文字列を 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");