<p>I can do an <code>eval("something()");</code> to execute the code dynamically in JavaScript. Is there a way for me to do the same thing in C#?</p>

<p>An example of what I am trying to do is: I have an integer variable (say <code>i</code>) and I have multiple properties by the names: "Property1", "Property2", "Property3", etc.
Now, I want to perform some operations on the " Property<em>i</em> " property depending on the value of <code>i</code>. </p>

<p>This is really simple with Javascript. Is there any way to do this with C#?</p>

You can use reflection to get the property and invoke it. Something like this:
```
```
object result = theObject.GetType().GetProperty("Property" + i).GetValue(theObject, null);
```
```
That is, assuming the object that has the property is called "theObject" :)