本文整理汇总了VB.NET中System.Runtime.InteropServices.ImportedFromTypeLibAttribute类的典型用法代码示例。如果您正苦于以下问题:VB.NET ImportedFromTypeLibAttribute类的具体用法?VB.NET ImportedFromTypeLibAttribute怎么用?VB.NET ImportedFromTypeLibAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImportedFromTypeLibAttribute类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: IsCOMAssembly
' 导入命名空间
Imports System.Reflection
Imports System.Runtime.InteropServices
Module A
Public Function IsCOMAssembly(ByVal a As System.Reflection.Assembly) As Boolean
Dim AsmAttributes As Object() = a.GetCustomAttributes(GetType(ImportedFromTypeLibAttribute), True)
If AsmAttributes.Length = 1 Then
Dim imptlb As ImportedFromTypeLibAttribute = AsmAttributes(0)
Dim strImportedFrom As String = imptlb.Value
' Print out the name of the DLL from which the assembly is imported.
Console.WriteLine("Assembly " + a.FullName + " is imported from " + strImportedFrom)
Return True
End If
' This is not a COM assembly.
Console.WriteLine("Assembly " + a.FullName + " is not imported from COM")
Return False
End Function
End Module