Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个用 c# 制作的程序,它包含更多图片和文件。
以及我如何制作一个包含所有图像和文件的 exe。
您可以在 Visual Studio 中使用应用程序资源。
右键单击项目(解决方案资源管理器)并转到属性
选择资源选项卡
添加你想要的(图像、文件、字符串等)
您可以按照以下方式在您的代码中访问它们
Properties.Resources.<Resource Name>
如果您将图像添加img1到资源
img1
你可以使用下面的代码来使用它
pictureBox1.Image = Properties.Resources.img1;