強力な暗号化方式の設定

Microsoft Excelでの暗号化の適用

Microsoft Excel(たとえば2007)でファイルの暗号化を実装するには:

  1. ツールメニューからオプションを選択します。
  2. セキュリティタブを選択します。
  3. 開くためのパスワードフィールドに値を入力します。
  4. 高度 をクリックします。
  5. 暗号化方式を選択し、パスワードを確認します。

Aspose.Cellsを使用した暗号化の適用

以下のコード例は、ファイルに強力な暗号化を適用し、パスワードを設定します。

// 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 dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Instantiate a Workbook object.
// Open an excel file.
Workbook workbook = new Workbook(dataDir+ "Book1.xlsx");
// Specify Strong Encryption type (RC4,Microsoft Strong Cryptographic Provider).
workbook.SetEncryptionOptions(EncryptionType.StrongCryptographicProvider, 128);
// Password protect the file.
workbook.Settings.Password = "1234";
// Save the Excel file.
workbook.Save(dataDir+ "encryptedBook1.out.xls");