3 <AttributeUsage(AttributeTargets.All)> _
\r
4 Public Class AuthorAttribute
\r
7 Public Sub New(ByVal Name As String)
\r
13 <Author("Robin Cook")> _
\r
22 Dim type As Type=GetType(C1)
\r
23 Dim arr As Object()=type.GetCustomAttributes(GetType(AuthorAttribute),True)
\r
24 If arr.Length=0 Then
\r
25 Console.WriteLine("Class has no attributes")
\r
27 Dim aa As AuthorAttribute=CType(arr(0),AuthorAttribute)
\r
28 Console.WriteLine("Name:" & aa.Name)
\r