Çalışma Sayfasının Parola Korumalı olup olmadığını algıla

Çalışma Sayfasının Parola Korumalı olup olmadığını algıla

Aspose.Cells for Java 8.7.0 ifşa ettiProtection.isProtectedWithPassword çalışma sayfasının parola korumalı olup olmadığını algılama özelliği. Boole tipiProtection.isProtectedWithPassword alan dönüşleridoğru EğerÇalışma kağıdı parola korumalıdır veYANLIŞ değilse.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(DetectWorksheetisPasswordProtected.class);
// Create an instance of Workbook and load a spreadsheet
Workbook book = new Workbook(dataDir + "sample.xlsx");
// Access the protected Worksheet
Worksheet sheet = book.getWorksheets().get(0);
// Check if Worksheet is password protected
if (sheet.getProtection().isProtectedWithPassword()) {
System.out.println("Worksheet is password protected");
}