title: Can I convert a string to a resource location in C#?
body: <p>Ok, beginner here just getting into learning programming, trying to make something in C#. Essentially, I have a string.. </p>
  
  <pre><code>string resourcename = "example"
  </code></pre>
  
  <p>Conveniently enough, I also have a resource called example.jpg.. Now I'm trying to set my backgroundimage to example.jpg, using the string 'resourcename' instead of the actual filename.. 
  Normally I'd do this:</p>
  
  <pre><code>this.BackgroundImage = namespace.Properties.Resources.example;
  </code></pre>
  
  <p>So now I'd like to do something like</p>
  
  <pre><code>this.BackgroundImage = namespace.Properties.Resources.resourcename;
  </code></pre>
  
  <p>Obviously, it doesn't recognize that because it's a string, so is there any way I can incorporate a string into the resource location?</p>
  
  <p>Thanks! : D</p>