How to execute code that is in a string?
<blockquote>
  <p><strong>Possible Duplicates:</strong><br>
  <a href="http://stackoverflow.com/questions/4629/c-eval-equivalent">C# eval equivalent?</a><br>
  <a href="http://stackoverflow.com/questions/1511376/c-execute-a-string-as-code">c# execute a string as code</a>  </p>
</blockquote>



<p>Say I have something like this:</p>

<pre><code>string singleStatement = "System.DateTime.Now";
</code></pre>

<p>Is there some way to take <code>singleStatement</code> and parse and run it at run time?</p>

<p>So that:</p>

<pre><code>DateTime currentTime = singleStatement.SomeCoolMethodToRunTheText();
</code></pre>

<p>would assign the value of <code>DateTime.Now</code> to <code>currentTime</code>.</p>
