Çalışma Sayfasının Parola Korumalı olup olmadığını algıla
Contents
[
Hide
]
Çalışma kitaplarını ve çalışma sayfalarını ayrı ayrı korumak mümkündür. Örneğin, bir elektronik tablo parola korumalı bir veya daha fazla çalışma sayfası içerebilir, ancak elektronik tablonun kendisi korumalı olabilir veya olmayabilir. Aspose.Cells API’ler, belirli bir çalışma sayfasının parola korumalı olup olmadığını algılamak için araçlar sağlar. Bu makale, aynı şeyi elde etmek için Aspose.Cells for Java API kullanımını göstermektedir.
Ç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.
This file contains hidden or 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
// 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"); | |
} |