Possible Duplicate:
load resource as byte array programmaticaly
Store Image in .resx as byte[] rather than Bitmap
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:
var foo = Resources.someProgram; // Foo is of type byte[]!
and if I then add an image to Resources.resx (someImage.png) then:
var foo2 = Resources.someImage; // Foo2 is of type Bitmap
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?
Edit
One solution would be to remove the file extension but I want to keep the files with their file extension...