首先创建一个VB.NET类库:
添加代码:
Public Shared Function IsFileSigned(filePath As String) As Boolean
Try
Dim certificate As X509Certificate = X509Certificate.CreateFromSignedFile(filePath)
Return True
Catch ex As Exception
Return False
End Try
End Function
然后右键-添加NuGet程序包-搜索:DllExport,然后进行引用。
安装完成之后,弹出的窗体中按下图来点击设置。
下面点击:全部重新加载
在代码顶部添加:
改变为:
<DllExport>
Public Shared Function IsFileSigned(filePath As String) As Boolean
Try
Dim certificate As X509Certificate = X509Certificate.CreateFromSignedFile(filePath)
Return True
Catch ex As Exception
Return False
End Try
End Function
然后在生成的同目录下找到X86目录,将DLL,放入易语言中,便可以引用。