在C#中的winform,如何安装与exe文件的资源(例如图像)? [英] in C# winform, how to attach a resource (an image for example) with the exe file?

查看:173
本文介绍了在C#中的winform,如何安装与exe文件的资源(例如图像)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如果我问的很对,但基本上所发生的事情是,我做它从资源文件夹加载其图像的winform应用程序..
的问题是,当我生成项目,并得到exe文件,并给它一个朋友,
他不会再有这样的资源文件夹像我这样做,所以他会得到一个错误说丢失的文件。

I don't know if I asked it right, but basically what happened is that I made a winform app which loads its image from the resource folder .. the problem is that when i build the project and get the exe and give it to a friend, he won't have that resource folder like i do, so he'll get an error saying missing file.

如何能以某种方式混合,或合并,或与我的应用程序附加图片

How can I somehow mix, or combine, or attach the image with my app?

推荐答案

您需要导航到属性,将其添加到项目窗口和将资源选项卡,并从那里添加图像。

You need to add it to the project by navigating to the Properties Window and going to the resource tab and adding the image from there.

另外,从PictureBox控件您可以从您的电脑中导入的资源。

Alternatively, from the PictureBox Control you can import resource from your computer.

这篇关于在C#中的winform,如何安装与exe文件的资源(例如图像)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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