Şifrelenmiş Dosyaların Parolasını Doğrulayın

Şifrelenmiş dosyanın parolasını doğrulayın

Aspose.Cells for .NET, şifreli dosyanın parolasını doğrulamak için şu bilgileri sağlar:Parolayı Doğrula yöntem. Bu yöntemler, dosya akışı ve doğrulanması gereken parola olmak üzere iki parametreyi kabul eder. Aşağıdaki kod parçacığı,Parolayı Doğrula Sağlanan parolanın geçerli olup olmadığını doğrulama yöntemi.

// 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);
// Create a Stream object
FileStream fstream = new FileStream(dataDir + "EncryptedBook1.xlsx", FileMode.Open);
bool isPasswordValid = FileFormatUtil.VerifyPassword(fstream, "1234");
Console.WriteLine("Password is Valid: " + isPasswordValid);