How can I copy an item from references to disk? (c#) -
For example, I have a flash movie in my reference, how can I copy it to a place outside the application?
Assuming you have an embedded resource, you want to do something like this:
{Reset input = assembly. GetManifestResourceStream (resource)) {If (input = = faucet) {new argument expression ("Resource name not found") "); } (Stream output = file by using the create (file)) {byte [buffer = new byte] [8 * 1024]; Read int; While (read (= input .reed (buffer, 0, buffer length)) gt; 0) {output.Write (buffer, 0, reading); }}}}Call it at:
WriteResourceToDisk (typeof (SomeKnownType). Assembly, "Foo.Bar.FlashFile.swf" "File .swf");
(Where Foo.Bar.FlashFile.swf
is the path to the resource.)
Comments
Post a Comment