FAQ
Contents
[
Hide
]
Kryptering och dekryptering stöds inte för Aspose.Cells for C++ nu
Nu stöds inte kryptering och dekryptering för Aspose.Cells for C++, så om du vill öppna en fil med lösenord kommer koden att skapa undantag.
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
#include "Aspose.Cells.h" | |
int main(void) | |
{ | |
try | |
{ | |
// Create a License object | |
intrusive_ptr<License> license = new License(); | |
// Set the license of Aspose.Cells to avoid the evaluation limitations | |
license->SetLicense(new String("Aspose.Cells.lic")); | |
// Create a LoadOption | |
intrusive_ptr<Aspose::Cells::ILoadOptions> loadOpt = Factory::CreateILoadOptions(LoadFormat::LoadFormat_Xlsx); | |
// Set the password with 123 for LoadOption | |
loadOpt->SetPassword(new String("123")); | |
// Open your encrypted file will throw exception | |
intrusive_ptr<Aspose::Cells::IWorkbook> wb = Factory::CreateIWorkbook(sourcePath->StringAppend(new String("Bookpassword.xlsx")), loadOpt); | |
} | |
catch (Exception& ex) | |
{ | |
Console::WriteLine(ex.GetMessageExp()); | |
} | |
} |