title: Save files as byte[] in Resources.resx
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9487726/load-resource-as-byte-array-programmaticaly">load resource as byte array programmaticaly</a><br>
    <a href="https://stackoverflow.com/questions/9901518/store-image-in-resx-as-byte-rather-than-bitmap">Store Image in .resx as byte[] rather than Bitmap</a>  </p>
  </blockquote>
  
  
  
  <p>I am creating a web service that will enable users to download several files. I keep those files on Resources.resx . The problem is that if I add a binary (someProgram.exe) file to Resources.resx then doing:</p>
  
  <pre><code> var foo = Resources.someProgram; // Foo is of type byte[]!
  </code></pre>
  
  <p>and if I then add an image to Resources.resx (someImage.png) then:</p>
  
  <pre><code> var foo2 = Resources.someImage; // Foo2 is of type Bitmap
  </code></pre>
  
  <p>I want all files on resources to be treated as binary. How can I do that? The moment I add an image it is of type Bitmap. How can I force it to be binary?</p>
  
  <h2>Edit</h2>
  
  <p>One solution would be to remove the file extension but I want to keep the files with their file extension...</p>