Node.js ve C++ kullanarak Çalışma Sayfası Parola Korumasını Tespit Etmek
Contents
[
Hide
]
Çalışma kitapları ve çalışma sayfaları ayrı ayrı korunabilir. Örneğin, bir elektronik tablo bir veya daha fazla parola korumalı çalışma sayfası içerebilir, ancak elektronik tablo kendisi korumalı veya değil olabilir. Aspose.Cells API’leri, belirli bir çalışma sayfasının parola korumalı olup olmadığını tespit etmenin yollarını sağlar. Bu makale, aynı amaca ulaşmak için Aspose.Cells for Node.js via C++ API’sinin kullanımını gösterir.
Aspose.Cells for Node.js via C++, bir çalışma sayfasının parola korumalı olup olmadığını tespit etmek için Protection.isProtectedWithPassword() özelliğini ortaya çıkardı. Boolean türündeki Protection.isProtectedWithPassword() özelliği, Worksheet password-protected ise true, değilse false döner.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Create an instance of Workbook and load a spreadsheet
const book = new AsposeCells.Workbook(filePath);
// Access the protected Worksheet
const sheet = book.getWorksheets().get(0);
// Check if Worksheet is password protected
if (sheet.getProtection().isProtectedWithPassword()) {
console.log("Worksheet is password protected");
} else {
console.log("Worksheet is not password protected");
}