|
Assembly update = Assembly.Load(...); //载入组件
//获取资源名称 String[] resources = update.GetManifestResourceNames();
//枚举资源 foreach(String s in resources){ using( //获取资源流 Stream res = update.GetManifestResourceStream(s), file = new FileStream(s, FileMode.CreateNew) //建立文件 ){ Int32 pseudoByte; while((pseudoByte = res.ReadByte())!=-1){ //复制字节 file.WriteByte((Byte)pseudoByte); } } }
提取组件资源代码 |