PropertyInfo Class represents the attributes of a property and provides access to property metadata.
Imports System.Reflection
Class Example
Public Shared Sub Main()
Dim test As String = "abcdefghijklmnopqrstuvwxyz"
Dim pinfo As PropertyInfo = GetType(String).GetProperty("Chars")
Dim indexArgs() As Object = { 6 }
Dim value As Object = pinfo.GetValue(test, indexArgs)
Console.WriteLine(value)
For i As Integer = 0 To test.Length - 1
Console.WriteLine(pinfo.GetValue(test, New Object() { i }))
Next
End Sub
End Class
Related examples in the same category