Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ExtractFile(string extPath, string asmPath)
- {
- PS3.ExtractFile(PS3.iAsm, extPath, "GUI.Resources." + asmPath);
- }
- public static void ExtractFile(Assembly _asm, string extPath, string asmPath)
- {
- byte[] bytes = PS3.ExtractBytes(_asm, asmPath);
- if (extPath.Contains("\\"))
- {
- Directory.CreateDirectory(Path.GetDirectoryName(extPath));
- }
- File.WriteAllBytes(extPath, bytes);
- }
- public static byte[] ExtractBytes(string asmPath)
- {
- return PS3.ExtractBytes(PS3.iAsm, "GUI.Resources." + asmPath);
- }
- public static byte[] ExtractBytes(Assembly _asm, string asmPath)
- {
- byte[] result;
- using (Stream manifestResourceStream = _asm.GetManifestResourceStream(asmPath))
- {
- using (MemoryStream memStream = new MemoryStream())
- {
- manifestResourceStream.CopyTo(memStream);
- result = memStream.ToArray();
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement