Skip to content

Instantly share code, notes, and snippets.

View xtrmstep's full-sized avatar
🏠
Working from home

Alexander Goida xtrmstep

🏠
Working from home
  • Sofia, Bulgaria
View GitHub Profile
@xtrmstep
xtrmstep / ExtractEmbeddedResourcesToFiles
Last active August 29, 2015 14:27
Extract text files embedded as resources to an assembly to files on disk
public void ExtractEmbeddedResourcesToFiles()
{
Assembly a = typeof (SomeTypeFromAssemblyWithResources).Assembly;
string d = Path.GetDirectoryName(a.Location);
string outputDir = Path.Combine(d, subFolder);
if (Directory.Exists(outputDir) == false)
{
Directory.CreateDirectory(outputDir);
}
List<string> rs = a.GetManifestResourceNames().Where(n => n.Contains(prefix)).ToList();