Skip to content

Instantly share code, notes, and snippets.

@shmup
Created February 22, 2016 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shmup/3f5abd617a525416fee7 to your computer and use it in GitHub Desktop.
Save shmup/3f5abd617a525416fee7 to your computer and use it in GitHub Desktop.
Type type = obj.GetType();
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo property in properties)
{
Console.WriteLine("Name: " + property.Name + ", Value: " + property.GetValue(obj, null));
}
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