获取嵌入的资源 [英] Get Embedded Resource

查看:137
本文介绍了获取嵌入的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个zip文件,我把它添加到我的程序的资源文件夹。我设置属性为嵌入的资源。

I have a zip file and I added it to my program's resource folder. I set the properties to embedded resource.

当我输入my.resources现在。 ......在列表中的文件的名称不来了,但其他图像文件来。

Now when I type my.resources. ...in the list the name of that file does not come but other image files comes.

我要提取的zip文件到一个文件夹在运行时。我这样做,是以前如果我的zip文件添加到我的解决方案。但是,如果zip文件添加到我的资源文件夹(右键点击资源,增加,现有的项目),那么如何从那里得到它。

I want to extract the zip file to a folder at runtime. I have done that before if I add zip file to my solution. But if the zip file is added into my resources folder (right click in resources, add, existing item) then how to get it from there.

帮助将AP preciated。我的计划是写在vb.net 2008年。

Help will be appreciated. My program is written in vb.net 2008.

干杯, GR

推荐答案

您需要将文件添加为一个类型的资源。添加文件只是资源文件夹不产生资源的包装性能。

You need to add the file as a typed resource. Adding file just to Resources folder does not generate resource wrapper property.

然后就可以通过引用

Dim fileConent As Byte() = My.Resources.FileName

替换为您的文件名的文件名。智能感知会引导你。

Replace the FileName with your file name. Intellisense will guide you.

这篇关于获取嵌入的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆