Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Collections
Imports System.Reflection
Imports System.Security
Class [MyClass]
Public myInt As Integer = 0
Public myString As String = Nothing
Public Sub New()
End Sub
Public Sub Myfunction()
End Sub
End Class
Class Type_GetMembers_BindingFlags
Public Shared Sub Main()
Try
Dim MyObject As New [MyClass]()
Dim myMemberInfo() As MemberInfo
Dim myType As Type = MyObject.GetType()
myMemberInfo = myType.GetMembers((BindingFlags.Public Or BindingFlags.Instance))
Console.WriteLine(myType)
Dim i As Integer
For i = 0 To myMemberInfo.Length - 1
Console.WriteLine("'{0}' is a {1}", myMemberInfo(i).Name, myMemberInfo(i).MemberType)
Next i
Catch e As SecurityException
Console.WriteLine(("SecurityException : " + e.Message.ToString()))
End Try
End Sub
End Class