我有assemvly EN coded到Base64的字符串在磁盘上。 它需要它的DLL重presentation。我可以加载到Assembly对象, 但找不到方法来保存它。谢谢!
I have assemvly encoded into Base64 string on disk. It's needed it dll representation. I can load it into Assembly object, but could not find way to save it. Thanks!
那么,1)如何保存大会类到磁盘的对象呢? 2)如何保存的base64 EN codeD组装成二进制的dll? [回答]
So, 1) how to save object of the Assembly class to disk? 2) how to save base64 encoded assembly to binary dll? [answered]
只是把它作为二进制 - 因此,使用 Convert.FromBase64String
获得字节[]
,写的是:
Just treat it as binary - So use Convert.FromBase64String
to get a byte[]
, and write that:
string base64 = File.ReadAllText(base64path);
byte[] binary = Convert.FromBase64String(base64);
File.WriteAllBytes(binaryPath, binary);
有关信息,在运行时对象的条件; AssemblyBuilder
有一个 .Save(...)
;但组装
不会。
For info, in terms of runtime objects; AssemblyBuilder
has a .Save(...)
; but Assembly
does not.
上一篇:麻烦与谷歌android系统中的地图面临麻烦、地图、系统、android
下一篇:Eclipse的" Java堆空间"错误是,Eclipse没有响应错误、空间、Eclipse、QUOT