Skip to content

Instantly share code, notes, and snippets.

@RockyMyx
Created May 29, 2013 05:27
Show Gist options
  • Save RockyMyx/5668159 to your computer and use it in GitHub Desktop.
Save RockyMyx/5668159 to your computer and use it in GitHub Desktop.
C#: Get-Embedded-Resource
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