检查 VBA 代码是否已签名
Contents
[
Hide
]
Aspose.Diagram 允许用户检查 VBA 代码项目是否已签名。请使用Diagram.VbaProject.IsSigned属性来检查 VBA 代码项目是否已签名。
下面的代码解释了如何使用Diagram.VbaProject.IsSigned财产。您可以使用任何 visio 文件来测试此代码。出于测试目的,您可以使用代码中使用的这个 visio 文件.
示例代码
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
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_Shapes(); | |
// Load a diagram | |
Diagram diagram = new Diagram(dataDir + "1.vsdm"); | |
// Signature is valid | |
Console.WriteLine("Is VBA Code Project Signed: " + diagram.VbaProject.IsSigned); | |
diagram.Save(dataDir + "1out.vsdm", SaveFileFormat.VSDM); |
控制台输出
下面是使用上述代码的控制台输出样本 visio 文件由链接提供。
Is VBA Code Project Signed: False