title: C# creating instance of class and set properties by name in string
body: <p>I have some problem. I want to creating instance of class by name.
  I found <code>Activator.CreateInstance</code> <a href="http://msdn.microsoft.com/en-us/library/d133hta4.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/d133hta4.aspx</a> and it works fine, and I found this:
  <a href="https://stackoverflow.com/questions/1089123/setting-a-property-by-reflection-with-a-string-value">Setting a property by reflection with a string value</a>
  too.</p>
  
  <p>But how to do both od this? I mean, I know the name of class, I know all properties in that class and I have this in string.
  For example:</p>
  
  <pre><code>string name = "MyClass";
  string property = "PropertyInMyClass";
  </code></pre>
  
  <p>How to create instance and set some value to properties ?</p>