[RESOLVED] for each property in myclassname?
Want to do a simple bit of code that will help me debug some custom classes I'm building, but I can't figure out how to do it.
All I want to do is console.writeline every property in a class... something like:
Code:
dim prop as Property
dim myclass as new myclassname
for each prop in myclass
console.writeline prop.name
console.writeline prop.value
next
Spent two hours searching so far, just easier to ask. Thanks.
Re: for each property in myclassname?
If you look in the System.Interop.Reflection namespace there's a bunch of useful classes for dissecting and enumerating the properties of a class....
e.g.
Code:
Dim DataObjectProperties() As PropertyInfo = MyObject.GetType.GetProperties()
(Where MyObject is the thingy you want to enumerate)
Re: for each property in myclassname?