Esporta certificato VBA su file o stream
Contents
[
Hide
]
Aspose.Cells consente di esportare il certificato digitale VBA in streaming come file o flusso di memoria. È possibile accedere ai dati grezzi del certificato digitale VBA utilizzando il fileCartella di lavoro.VbaProject.CertRawData proprietà.
Esporta certificato VBA su file o streaming in C#
Si prega di vedere il seguente codice di esempio che salva i dati grezzi del certificato VBA in un file. Puoi scaricare ilfile excel di esempio utilizzato in questo codice dal link fornito.
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load your source excel file into workbook object | |
Workbook workbook = new Workbook(dataDir + "sampleVBAProjectSigned.xlsm"); | |
// Retrieve bytes data of Digital Certificate of VBA Project | |
byte[] certBytes = workbook.VbaProject.CertRawData; | |
// Save Certificate Data into FileStream | |
File.WriteAllBytes(dataDir + "Cert_out_", certBytes); |