什么是资源,并在C#应用程序嵌入的资源之间的区别?
问题描述:
当我应该使用一个或其他?
When should I use one or the other?
我想所有我在我的应用程序使用的文件(图片,声音,XML文件等。 )是.exe文件里面,所以我不跟一堆文件夹和文件的部署。
I'd like all of the files I use in my app (images, sound, xml file, etc.) to be inside of the .exe file so I don't deploy with a bunch of folders and files.
感谢您的信息。
答
资源和内容建设行动来访问使用的URI WPF资源。然而嵌入的资源是一个事先的技术。但是这两种选择嵌入了资源汇编,但资源选项用于WPF。
"Resource" and "Content" build actions are to access the WPF resources using the Uris. However "Embedded Resource" is for prior technologies. However both options embeds the resource in assembly but "Resource" option to be used for WPF.
MSDN privides完整的解释的这里
MSDN privides full explanation here