How would I access an object's variable's value if I only have the name of the variable I wish to access? In C#.
Say I had a list of variable names represented as strings in an array. How would I access them in a loop, for example. I can do something like the following in Actionscript:
var arrayOfVariableNames:Array = ["name", "age", "sex"]
for each(var person:Person in persons)
{
if (person[age] > 29) //what is equivalent in c# for object[field]
{
//do something
}
}