Created
May 29, 2013 05:27
-
-
Save RockyMyx/5668159 to your computer and use it in GitHub Desktop.
C#: Get-Embedded-Resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assembly asm = Assembly.GetExecutingAssembly(); | |
var names = (from n in asm.GetManifestResourceNames() | |
where n.EndsWith(".png") | |
select n | |
).ToList(); | |
Dictionary<string, System.IO.Stream> resources = new Dictionary<string, System.IO.Stream>(); | |
foreach (string name in names) | |
{ | |
resources.Add(name, asm.GetManifestResourceStream(name)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment