Imports System
Imports System.Reflection
Class MyMainClass
Shared Sub Main()
Dim moduleArray() As [Module]
moduleArray = [Assembly].GetExecutingAssembly().GetModules(False)
Dim myModule As [Module] = moduleArray(0)
Dim attributes() As Object
attributes = myModule.GetCustomAttributes(True)
Dim o As [Object]
For Each o In attributes
Console.WriteLine("Found this attribute on myModule: {0}", o.ToString())
Next o
End Sub
End Class
_
Public Class MySimpleAttribute
Inherits Attribute
Private name As String
Public Sub New(ByVal newName As String)
name = newName
End Sub
End Class