<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2FDevelopment%2FReflection</id>
		<title>VB.Net/Development/Reflection - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2FDevelopment%2FReflection"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/Development/Reflection&amp;action=history"/>
		<updated>2026-04-05T07:00:48Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/Development/Reflection&amp;diff=764&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/Development/Reflection&amp;diff=764&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/Development/Reflection&amp;diff=765&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/Development/Reflection&amp;diff=765&amp;oldid=prev"/>
				<updated>2010-05-26T12:45:04Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Define Attributes and Use Reflection to get its value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System.Reflection&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
   Public Shared Sub Main()&lt;br /&gt;
        Dim MethodObj As System.Reflection.MethodInfo&lt;br /&gt;
        Dim MessageDemo As New Demo()&lt;br /&gt;
        For Each MethodObj In MessageDemo.GetType.GetMethods()&lt;br /&gt;
            Dim Attr As Attribute&lt;br /&gt;
            For Each Attr In MethodObj.GetCustomAttributes(False)&lt;br /&gt;
                Console.WriteLine(MethodObj.Name)&lt;br /&gt;
                Console.WriteLine(Attr)&lt;br /&gt;
                Console.WriteLine(CType(Attr, UserName).Name)&lt;br /&gt;
            Next&lt;br /&gt;
        Next&lt;br /&gt;
   &lt;br /&gt;
   End Sub&lt;br /&gt;
End Class &lt;br /&gt;
&lt;br /&gt;
Class UserName&lt;br /&gt;
    Inherits Attribute&lt;br /&gt;
    Public Name As String &lt;br /&gt;
    Public Sub New(ByVal Name As String)&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        Me.Name = Name&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Class Demo&lt;br /&gt;
    &amp;lt;UserName(&amp;quot;Name 1&amp;quot;)&amp;gt; Sub DemoMsg()&lt;br /&gt;
        Console.WriteLine(&amp;quot;Message&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;lt;UserName(&amp;quot;Name 2&amp;quot;)&amp;gt; Sub Greet()&lt;br /&gt;
        Console.WriteLine(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Fill Reflection Data into ListView==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Reflection&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.IO&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    &lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim form1 As Form = New Form1&lt;br /&gt;
        Application.Run(form1)&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        &amp;quot; Make column headers.&lt;br /&gt;
        lvwProperties.View = View.Details&lt;br /&gt;
        lvwProperties.Columns.Clear()&lt;br /&gt;
        lvwProperties.Columns.Add(&amp;quot;Property&amp;quot;, 10, HorizontalAlignment.Left)&lt;br /&gt;
        lvwProperties.Columns.Add(&amp;quot;Type&amp;quot;, 10, HorizontalAlignment.Left)&lt;br /&gt;
        lvwProperties.Columns.Add(&amp;quot;Value&amp;quot;, 10,HorizontalAlignment.Left)&lt;br /&gt;
        Dim property_value As Object&lt;br /&gt;
        Dim properties_info As PropertyInfo() = GetType(Form1).GetProperties()&lt;br /&gt;
        lvwProperties.Items.Clear()&lt;br /&gt;
        For i As Integer = 0 To properties_info.Length - 1&lt;br /&gt;
            With properties_info(i)&lt;br /&gt;
                If .GetIndexParameters().Length = 0 Then&lt;br /&gt;
                    property_value = .GetValue(Me, Nothing)&lt;br /&gt;
                    If property_value Is Nothing Then&lt;br /&gt;
                        ListViewMakeRow(lvwProperties, _&lt;br /&gt;
                            .Name, _&lt;br /&gt;
                            .PropertyType.ToString, _&lt;br /&gt;
                            &amp;quot;&amp;lt;Nothing&amp;gt;&amp;quot;)&lt;br /&gt;
                    Else&lt;br /&gt;
                        ListViewMakeRow(lvwProperties, _&lt;br /&gt;
                            .Name, _&lt;br /&gt;
                            .PropertyType.ToString, _&lt;br /&gt;
                            property_value.ToString)&lt;br /&gt;
                    End If&lt;br /&gt;
                Else&lt;br /&gt;
                    ListViewMakeRow(lvwProperties, _&lt;br /&gt;
                        .Name, _&lt;br /&gt;
                        .PropertyType.ToString, _&lt;br /&gt;
                        &amp;quot;&amp;lt;array&amp;gt;&amp;quot;)&lt;br /&gt;
                End If&lt;br /&gt;
            End With&lt;br /&gt;
        Next i&lt;br /&gt;
        lvwProperties.Columns(0).Width = -2&lt;br /&gt;
        lvwProperties.Columns(1).Width = -2&lt;br /&gt;
        lvwProperties.Columns(2).Width = -2&lt;br /&gt;
        Dim new_wid As Integer = 30&lt;br /&gt;
        For i As Integer = 0 To lvwProperties.Columns.Count - 1&lt;br /&gt;
            new_wid += lvwProperties.Columns(i).Width&lt;br /&gt;
        Next i&lt;br /&gt;
        Me.Size = New Size(new_wid, Me.Size.Height)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub ListViewMakeRow(ByVal lvw As ListView, ByVal item_title As String, ByVal ParamArray subitem_titles() As String)&lt;br /&gt;
        Dim new_item As ListViewItem = lvw.Items.Add(item_title)&lt;br /&gt;
        For i As Integer = subitem_titles.GetLowerBound(0) To _&lt;br /&gt;
            subitem_titles.GetUpperBound(0)&lt;br /&gt;
            new_item.SubItems.Add(subitem_titles(i))&lt;br /&gt;
        Next i&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.lvwProperties = New System.Windows.Forms.ListView&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;lvwProperties&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.lvwProperties.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.lvwProperties.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.lvwProperties.Name = &amp;quot;lvwProperties&amp;quot;&lt;br /&gt;
        Me.lvwProperties.Size = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.lvwProperties.TabIndex = 1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.Controls.Add(Me.lvwProperties)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;ReflectionListProperties&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents lvwProperties As System.Windows.Forms.ListView&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Get Class Member and Property Information from base and inherited Class==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System.Reflection&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
   Public Shared Sub Main()&lt;br /&gt;
        Dim Book = New Derived()&lt;br /&gt;
        Dim Member As MemberInfo&lt;br /&gt;
        Console.WriteLine(&amp;quot;Members:&amp;quot;)&lt;br /&gt;
        For Each Member In Book.GetType.GetMembers()&lt;br /&gt;
            Console.WriteLine(Member.Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; Member.MemberType)&lt;br /&gt;
        Next&lt;br /&gt;
        Dim PropertyObj As PropertyInfo&lt;br /&gt;
        Console.WriteLine(&amp;quot;Properties:&amp;quot;)&lt;br /&gt;
        For Each PropertyObj In Book.GetType.GetProperties()&lt;br /&gt;
            Console.WriteLine(PropertyObj.Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; PropertyObj.PropertyType.ToString())&lt;br /&gt;
        Next&lt;br /&gt;
        Dim MethodObj As MethodInfo&lt;br /&gt;
        Console.WriteLine(&amp;quot;Methods:&amp;quot;)&lt;br /&gt;
        For Each MethodObj In Book.GetType.GetMethods()&lt;br /&gt;
            Console.WriteLine(MethodObj.Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; MethodObj.ReturnType.ToString())&lt;br /&gt;
        Next&lt;br /&gt;
        Dim EventObj As EventInfo&lt;br /&gt;
        Console.WriteLine(&amp;quot;Events:&amp;quot;)&lt;br /&gt;
        For Each EventObj In Book.GetType.GetEvents()&lt;br /&gt;
            Console.WriteLine(EventObj.Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; EventObj.IsMulticast)&lt;br /&gt;
        Next&lt;br /&gt;
        Dim InterfaceObj As Type&lt;br /&gt;
        Console.WriteLine(&amp;quot;Events:&amp;quot;)&lt;br /&gt;
        For Each InterfaceObj In Book.GetType.GetInterfaces()&lt;br /&gt;
            Console.WriteLine(InterfaceObj.Name)&lt;br /&gt;
        Next&lt;br /&gt;
   &lt;br /&gt;
   End Sub&lt;br /&gt;
End Class &lt;br /&gt;
    Class Base&lt;br /&gt;
        Public ProductID As String&lt;br /&gt;
        Public Weight As Double&lt;br /&gt;
        Private ProductPrice As Double&lt;br /&gt;
        Public Sub New()&lt;br /&gt;
        End Sub&lt;br /&gt;
        Public ReadOnly Property Price() As Double&lt;br /&gt;
            Get&lt;br /&gt;
                Return 0&lt;br /&gt;
            End Get&lt;br /&gt;
        End Property&lt;br /&gt;
    End Class&lt;br /&gt;
    Class Derived&lt;br /&gt;
        Inherits Base&lt;br /&gt;
        Implements IFormattable&lt;br /&gt;
        Public Title As String&lt;br /&gt;
        Public Author As String&lt;br /&gt;
        Public Publisher As String&lt;br /&gt;
        Public Overridable Overloads Function ToString(ByVal _&lt;br /&gt;
          Format As String, ByVal Provider As IFormatProvider) _&lt;br /&gt;
          As String Implements IFormattable.ToString&lt;br /&gt;
            ToString = Title&lt;br /&gt;
        End Function&lt;br /&gt;
        Public Sub New()&lt;br /&gt;
            MyBase.New()&lt;br /&gt;
        End Sub&lt;br /&gt;
    End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Get Method Information==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System.Reflection&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
   Public Shared Sub Main()&lt;br /&gt;
        Dim SomeObj = New Demo()&lt;br /&gt;
        Dim MethodObj As System.Reflection.MethodInfo&lt;br /&gt;
        Console.WriteLine()&lt;br /&gt;
        Console.WriteLine(&amp;quot;Methods:&amp;quot;)&lt;br /&gt;
        For Each MethodObj In SomeObj.GetType.GetMethods()&lt;br /&gt;
            Console.WriteLine(MethodObj.Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; MethodObj.ReturnType.ToString())&lt;br /&gt;
            Dim Param As ParameterInfo&lt;br /&gt;
            For Each Param In MethodObj.GetParameters()&lt;br /&gt;
                Console.WriteLine(Param.Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; Param.ParameterType.ToString())&lt;br /&gt;
            Next&lt;br /&gt;
            Console.WriteLine()&lt;br /&gt;
        Next&lt;br /&gt;
   &lt;br /&gt;
   End Sub&lt;br /&gt;
End Class &lt;br /&gt;
&lt;br /&gt;
    Class Demo&lt;br /&gt;
        Public Sub A()&lt;br /&gt;
        End Sub&lt;br /&gt;
        Public Sub B(ByVal Msg As String)&lt;br /&gt;
        End Sub&lt;br /&gt;
        Public Function C(ByVal A As Integer, ByVal B As Integer) As Integer&lt;br /&gt;
        End Function&lt;br /&gt;
        Public Sub D(ByVal A As Double, ByVal B As Double, ByVal C As Double)&lt;br /&gt;
        End Sub&lt;br /&gt;
    End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Get Method information and invoke Method using Reflection API==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System.Reflection&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
   Public Shared Sub Main()&lt;br /&gt;
        Dim SomeObj = New Demo()&lt;br /&gt;
        Dim IntegerVar As Integer = 1&lt;br /&gt;
        Dim DoubleVar As Double = 100.0&lt;br /&gt;
        Dim StringVar As String = &amp;quot;Hello&amp;quot;&lt;br /&gt;
        Dim Param As ParameterInfo&lt;br /&gt;
        Dim MethodObj As System.Reflection.MethodInfo&lt;br /&gt;
        For Each MethodObj In SomeObj.GetType.GetMethods()&lt;br /&gt;
            Dim Parameters(MethodObj.GetParameters().Length - 1) As Object&lt;br /&gt;
            Dim CallMethod As Boolean = True&lt;br /&gt;
            Dim I As Integer = 0&lt;br /&gt;
            For Each Param In MethodObj.GetParameters()&lt;br /&gt;
                If Equals(Param.ParameterType, IntegerVar.GetType()) Then&lt;br /&gt;
                    Parameters(I) = IntegerVar&lt;br /&gt;
                ElseIf Equals(Param.ParameterType, DoubleVar.GetType()) Then&lt;br /&gt;
                    Parameters(I) = DoubleVar&lt;br /&gt;
                ElseIf Equals(Param.ParameterType, StringVar.GetType()) Then&lt;br /&gt;
                    Parameters(I) = StringVar&lt;br /&gt;
                Else&lt;br /&gt;
                    CallMethod = False&lt;br /&gt;
                End If&lt;br /&gt;
                I = I + 1&lt;br /&gt;
            Next&lt;br /&gt;
            If (CallMethod) Then&lt;br /&gt;
                If MethodObj.GetParameters().Length = 0 Then&lt;br /&gt;
                    Console.WriteLine(&amp;quot;Calling: &amp;quot; &amp;amp; MethodObj.Name)&lt;br /&gt;
                    Console.WriteLine(MethodObj.Invoke(SomeObj, Nothing))&lt;br /&gt;
                Else&lt;br /&gt;
                    Console.WriteLine(&amp;quot;Calling: &amp;quot; &amp;amp; MethodObj.Name)&lt;br /&gt;
                    Console.WriteLine(MethodObj.Invoke(SomeObj, Parameters))&lt;br /&gt;
                End If&lt;br /&gt;
            End If&lt;br /&gt;
            Console.WriteLine()&lt;br /&gt;
        Next&lt;br /&gt;
   &lt;br /&gt;
   End Sub&lt;br /&gt;
End Class &lt;br /&gt;
&lt;br /&gt;
    Class Demo&lt;br /&gt;
        Public Sub Hello()&lt;br /&gt;
        End Sub&lt;br /&gt;
        Public Sub ShowMessage(ByVal Msg As String)&lt;br /&gt;
        End Sub&lt;br /&gt;
        Public Function AddTwoIntegers(ByVal A As Integer, ByVal B As Integer) As Integer&lt;br /&gt;
        End Function&lt;br /&gt;
        Public Sub ShowThreeDoubles(ByVal A As Double, ByVal B As Double, ByVal C As Double)&lt;br /&gt;
        End Sub&lt;br /&gt;
    End Class&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reflection: display the member of Form Class==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.IO&lt;br /&gt;
Imports System.Xml.Serialization&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Drawing.Printing&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
      Dim aForm As New Windows.Forms.Form()&lt;br /&gt;
      Dim aType As Type&lt;br /&gt;
      aType = aForm.GetType()&lt;br /&gt;
      Dim member As Object&lt;br /&gt;
      Console.WriteLine(&amp;quot;Members of the Form class&amp;quot;)&lt;br /&gt;
      For Each member In aType.GetMembers&lt;br /&gt;
        Console.Write(member.ToString)&lt;br /&gt;
      Next&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reflection Information for Integer Class==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
public class MainClass&lt;br /&gt;
   Shared Sub Main()&lt;br /&gt;
        Dim i As Integer = 15&lt;br /&gt;
        Console.WriteLine(i.ToString())&lt;br /&gt;
        Console.WriteLine(&amp;quot;Hash is: &amp;quot; + i.GetHashCode().ToString())&lt;br /&gt;
        Console.WriteLine(&amp;quot;Type is: &amp;quot; + i.GetType().ToString)&lt;br /&gt;
        Console.WriteLine(&amp;quot;Type full name is: &amp;quot; + i.GetType().FullName())&lt;br /&gt;
        Console.WriteLine(&amp;quot;Type assembly qualified name is: &amp;quot; + i.GetType().AssemblyQualifiedName)&lt;br /&gt;
        Console.WriteLine(&amp;quot;Namespace is: &amp;quot; + i.GetType().Namespace)&lt;br /&gt;
   End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reflector Utilities==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Reflector&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.lblAssembly = New System.Windows.Forms.Label&lt;br /&gt;
        Me.treeTypes = New System.Windows.Forms.TreeView&lt;br /&gt;
        Me.cmdReflect = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;lblAssembly&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.lblAssembly.Location = New System.Drawing.Point(10, 9)&lt;br /&gt;
        Me.lblAssembly.Name = &amp;quot;lblAssembly&amp;quot;&lt;br /&gt;
        Me.lblAssembly.Size = New System.Drawing.Size(272, 12)&lt;br /&gt;
        Me.lblAssembly.TabIndex = 5&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;treeTypes&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.treeTypes.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Left) _&lt;br /&gt;
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.treeTypes.Location = New System.Drawing.Point(10, 29)&lt;br /&gt;
        Me.treeTypes.Name = &amp;quot;treeTypes&amp;quot;&lt;br /&gt;
        Me.treeTypes.Size = New System.Drawing.Size(362, 276)&lt;br /&gt;
        Me.treeTypes.TabIndex = 4&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;cmdReflect&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.cmdReflect.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)&lt;br /&gt;
        Me.cmdReflect.Location = New System.Drawing.Point(300, 313)&lt;br /&gt;
        Me.cmdReflect.Name = &amp;quot;cmdReflect&amp;quot;&lt;br /&gt;
        Me.cmdReflect.Size = New System.Drawing.Size(72, 28)&lt;br /&gt;
        Me.cmdReflect.TabIndex = 3&lt;br /&gt;
        Me.cmdReflect.Text = &amp;quot;Reflect&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Reflector&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(382, 350)&lt;br /&gt;
        Me.Controls.Add(Me.lblAssembly)&lt;br /&gt;
        Me.Controls.Add(Me.treeTypes)&lt;br /&gt;
        Me.Controls.Add(Me.cmdReflect)&lt;br /&gt;
        Me.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.Name = &amp;quot;Reflector&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Reflector&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents lblAssembly As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents treeTypes As System.Windows.Forms.TreeView&lt;br /&gt;
    Friend WithEvents cmdReflect As System.Windows.Forms.Button&lt;br /&gt;
    Private Sub cmdReflect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReflect.Click&lt;br /&gt;
        treeTypes.Nodes.Clear()&lt;br /&gt;
        Dim MyAssembly As System.Reflection.Assembly&lt;br /&gt;
        MyAssembly = System.Reflection.Assembly.GetExecutingAssembly()&lt;br /&gt;
        lblAssembly.Text = MyAssembly.FullName&lt;br /&gt;
        Dim MyTypes(), MyType As Type&lt;br /&gt;
        Dim MyEvents(), MyEvent As System.Reflection.EventInfo&lt;br /&gt;
        Dim MyMethods(), MyMethod As System.Reflection.MethodInfo&lt;br /&gt;
        Dim MyProperties(), MyProperty As System.Reflection.PropertyInfo&lt;br /&gt;
        MyTypes = MyAssembly.GetTypes()&lt;br /&gt;
        For Each MyType In MyTypes&lt;br /&gt;
            Dim nodeParent As TreeNode = treeTypes.Nodes.Add(MyType.FullName)&lt;br /&gt;
            Dim node As TreeNode = nodeParent.Nodes.Add(&amp;quot;Events&amp;quot;)&lt;br /&gt;
            MyEvents = MyType.GetEvents&lt;br /&gt;
            For Each MyEvent In MyEvents&lt;br /&gt;
                node.Nodes.Add(MyEvent.Name &amp;amp; &amp;quot; - event handler signature: &amp;quot; &amp;amp; _&lt;br /&gt;
                 MyEvent.EventHandlerType.Name)&lt;br /&gt;
            Next&lt;br /&gt;
            node = nodeParent.Nodes.Add(&amp;quot;Methods&amp;quot;)&lt;br /&gt;
            MyMethods = MyType.GetMethods()&lt;br /&gt;
            For Each MyMethod In MyMethods&lt;br /&gt;
                node.Nodes.Add(MyMethod.Name)&lt;br /&gt;
            Next&lt;br /&gt;
            node = nodeParent.Nodes.Add(&amp;quot;Properties&amp;quot;)&lt;br /&gt;
            MyProperties = MyType.GetProperties&lt;br /&gt;
            For Each MyProperty In MyProperties&lt;br /&gt;
                node.Nodes.Add(MyProperty.Name &amp;amp; &amp;quot;- data type: &amp;quot; &amp;amp; _&lt;br /&gt;
                MyProperty.PropertyType.ToString())&lt;br /&gt;
            Next&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use Reflection to create Class instance and call method==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt; &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Reflection&lt;br /&gt;
 &lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main(  )&lt;br /&gt;
         Dim theMathType As Type = Type.GetType(&amp;quot;System.Math&amp;quot;)&lt;br /&gt;
         Dim paramTypes(0) As Type&lt;br /&gt;
         paramTypes(0) = Type.GetType(&amp;quot;System.Double&amp;quot;)&lt;br /&gt;
         Dim ConsineInfo As MethodInfo = _&lt;br /&gt;
             theMathType.GetMethod(&amp;quot;Sin&amp;quot;, paramTypes)&lt;br /&gt;
         Dim parameters(0) As Object&lt;br /&gt;
         parameters(0) = 45 * (Math.PI / 180)&lt;br /&gt;
         Dim returnVal As Object&lt;br /&gt;
         returnVal = ConsineInfo.Invoke(theMathType, parameters)&lt;br /&gt;
         Console.WriteLine(&amp;quot;The sine of a 45 degree angle is {0}&amp;quot;, _&lt;br /&gt;
             returnVal)&lt;br /&gt;
    End Sub&lt;br /&gt;
  &lt;br /&gt;
End Class&lt;br /&gt;
  &lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>