本文整理汇总了VB.NET中System.Reflection.Assembly.IsDefined方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Assembly.IsDefined方法的具体用法?VB.NET Assembly.IsDefined怎么用?VB.NET Assembly.IsDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Assembly
的用法示例。
在下文中一共展示了Assembly.IsDefined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Test
' 导入命名空间
Imports System.Reflection
' Set an assembly attribute.
<Assembly:AssemblyTitleAttribute("A title example")>
' Note that the suffix "Attribute" can be omitted:
' <Assembly:AssemblyTitle("A title examle")>
Public Class Test
Public Shared Sub Main()
' Get the assembly that is executing this method.
Dim asm As [Assembly] = [Assembly].GetCallingAssembly
' Get the attribute type just defined.
Dim aType As Type = GetType(AssemblyTitleAttribute)
Console.WriteLine(asm.IsDefined(aType, false))
' Try an attribute not defined.
aType = GetType(AssemblyVersionAttribute)
Console.WriteLine(asm.IsDefined(aType, false))
End Sub
End Class
输出:
True False