One of the series of VB. NET articles
Through examples, we will talk about the application of Reflection.
Note:
It should be said that this short article is not an in-depth analytical article, so I added the word "talking" before the title, hoping that for average readers, it gives you a more intuitive understanding of reflection.
-- 2005/05/23 in Dongguan
Here, we will briefly explain the concepts of reflection and reflection at the end.
1. Create an assembly file for testing.
First, you need to create a class library file (with the. dll extension after compilation). The name is assumed to be reflection_newtest.
The system will create a new class file class1 by default and convert it to the class person we use for testing.
The Code is as follows: (the class code is relatively simple and will not be explained here. For details, see the Class documentation .)
Public Class person
Public firstname As String
Public lastname As String
Dim m_age As Short
Dim m_emailaddress (4) As String
Public Sub New ()
MyBase. new ()
End Sub
Public Sub New (ByVal firstname As String, ByVal lastname As String)
Me. firstname = firstname
Me. lastname = lastname
End Sub
Public Property age () As Short
Get