You can use reflection to access a field by its name :
FieldInfo ageField = typeof(Person).GetField("age");
int age = (int) field.GetValue(person);
solved C# Accessing field syntax
You can use reflection to access a field by its name :
FieldInfo ageField = typeof(Person).GetField("age");
int age = (int) field.GetValue(person);
solved C# Accessing field syntax