Created
February 22, 2016 19:41
-
-
Save shmup/3f5abd617a525416fee7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type type = obj.GetType(); | |
PropertyInfo[] properties = type.GetProperties(); | |
foreach (PropertyInfo property in properties) | |
{ | |
Console.WriteLine("Name: " + property.Name + ", Value: " + property.GetValue(obj, null)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim type As Type = obj.[GetType]() | |
Dim properties As PropertyInfo() = type.GetProperties() | |
For Each [property] As PropertyInfo In properties | |
Console.WriteLine("Name: " + [property].Name + ", Value: " + [property].GetValue(obj, Nothing)) | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment