Imports System.Reflection
Public
Class Form1
Private
Sub Button1_Click(
ByVal sender
As System.Object,255)">ByVal e
As System.EventArgs)
Handles Button1.Click
Dim o
As
Object = Activator.CreateInstance(Type.GetType(
"
A.a
"))
'
工程名称.类名
Dim MyProperty
As PropertyInfo = o.GetType().GetProperty(
NAME
")
Dim objValue
Object =
"
Bbb
"
MyProperty.SetValue(o,objValue,255)">Nothing)
Dim objReturn()
Object
MsgBox(MyProperty.GetValue(o,objReturn).ToString())
End Sub
End Class
Class a
private _name
String
Public _id
Integer
Property NAME()
As
String
Get
Return _name
End
Get
Set(
ByVal value
String)
_name = value
Set
End Property
End Class 原文链接:/vb/258687.html