
Dekripsi atau Enkripsi File Excel menggunakan Node.js
- Dekripsi atau Enkripsi File Excel menggunakan Node.js - instalasi API
- Cara Mengenkripsi File Excel secara terprogram
- Pustaka Node.js untuk Mendekripsi File Excel
Dekripsi atau Enkripsi File Excel menggunakan Node.js - instalasi API
Pustaka Node.js Excel menawarkan berbagai manipulasi file dan fitur konversi. Pengguna dapat menemukan [dokumentasi] lengkap6 beserta contoh dan deskripsinya. Ini cukup mudah dipasang dan mudah digunakan. Jalankan perintah berikut untuk menyiapkan pustaka ini di proyek Anda:
npm install java
npm install aspose.cells
Cara Mengenkripsi File Excel secara terprogram
Menyiapkan kata sandi ke file Excel secara terprogram menjadi sangat mudah dan kuat. Selain itu, Anda dapat menentukan jenis dan kekuatan enkripsi dengan menerapkan metode yang diekspos oleh [library Node.js Excel] ini7. Ikuti langkah-langkah berikut dan cuplikan kode untuk mengenkripsi file Excel menggunakan Node.js:
- Ambil modul aspose.cells ke dalam proyek Node.js Anda.
- Menginisialisasi instance dari kelas Workbook.
- Akses pengaturan Buku Kerja dengan memanggil metode getSettings() dan atur kata sandi dengan memanggil setPassword(string).
- Panggil metode setEncryptionOptions untuk menyetel jenis enkripsi.
- save(fileName, saveFormat) akan menyimpan file terenkripsi.
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
var aspose = aspose || {}; // Fetch the aspose.cells module into your Node.js project. aspose.cells = require("aspose.cells"); // Initializes an instance of the Workbook class. var wb = new aspose.cells.Workbook("sample.xlsx"); // Access the Workbook settings by calling the getSettings() method and set the password by invoking setPassword(string). wb.getSettings().setPassword("password"); // Call setEncryptionOptions method to set the encryption type. wb.setEncryptionOptions(1,128) // save(fileName, saveFormat) will save the encrypted file. wb.save("encrypted-file.xlsx");
Pustaka Node.js untuk Mendekripsi File Excel
Di bagian ini, kita akan melalui langkah-langkah berikut dan cuplikan kode yang mendekripsi file Excel terenkripsi secara terprogram:
- Buat instance kelas LoadOptions untuk mengakses opsi file XLSX.
- Masukkan kata sandi yang benar dari file terenkripsi dengan memanggil metode setPassword(string).
- Buat objek dari kelas Workbook dan muat file terenkripsi sumber dengan instance loadOptions.
- Setel sandi ke NULL dengan mengaktifkan setPassword().
- Panggil save(fileName, saveFormat) akan menyimpan file yang didekripsi.
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
var aspose = aspose || {}; // Fetch the aspose.cells module into your Node.js project. aspose.cells = require("aspose.cells"); // Initializes an instance of the Workbook class. var wb = new aspose.cells.Workbook("sample.xlsx"); // Access the Workbook settings by calling the getSettings() method and set the password by invoking setPassword(string). wb.getSettings().setPassword("password"); // Call setEncryptionOptions method to set the encryption type. wb.setEncryptionOptions(1,128) // save(fileName, saveFormat) will save the encrypted file. wb.save("encrypted-file.xlsx");
Dapatkan Lisensi Gratis
Anda dapat memanfaatkan lisensi sementara gratis untuk mencoba API tanpa batasan evaluasi.
Menyimpulkan
Kami harap Anda telah mempelajari cara Mendekripsi atau Mengenkripsi File Excel menggunakan Node.js secara terprogram. Kami telah melalui cuplikan kode dan juga telah menyebutkan tautan perpustakaan tempat Anda dapat menemukan daftar lengkap metode yang tersedia. Selain itu, Anda dapat menjelajahi tautan relevan lainnya yang disebutkan di bagian “Lihat Juga” di bawah. Selanjutnya, conholdate.com sedang menulis posting blog baru tentang topik baru. Oleh karena itu, harap tetap berhubungan untuk pembaruan rutin.
Berikan pertanyaan
Anda dapat membagikan pertanyaan atau pertanyaan Anda di forum kami.