I\'m setting up a simple helper class to hold some data from a file I\'m parsing. The names of the properties match the names of values that I expect to find in the file.
Using reflection you get the property using the name and set its value... something like:
Type t = this.GetType(); var prop = t.GetProperty(propName); prop.SetValue(this, value, null);