Advertisement
manski

Write DLL resource to file

Jun 13th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. Assembly assembly = Assembly.GetExecutingAssembly();
  2. // IMPORTANT:
  3. //   * Resource names must be qualified with the assembly's namespace
  4. //   * Resource's build action is "Embedded Resource"
  5. Stream resStream = assembly.GetManifestResourceStream("MyNamespace.myres.txt");
  6. using (Stream file = File.OpenWrite("mydest.txt")) {
  7.   resStream.CopyTo(file);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement