What's the difference between a Resource and an Embedded Resource in a C# application?

后端 未结 4 1957
南方客
南方客 2020-12-08 03:36

When should I use one or the other?

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

4条回答
  •  借酒劲吻你
    2020-12-08 04:24

    As reported by MSDN,

    Embedded resources are the best choice if you have to share application resource (.resx) files between multiple projects. For example, if you have a common resource file that contains your company's logos, trademark information, and such, using embedded resources means you have to copy only the .resx file and not the associated resource data files.

    You cannot edit embedded resources directly. If you try to edit an embedded resource, you will receive a message prompting you to convert the item to a linked resource in order to edit it. Conversion is recommended but optional. You must export them, make your modifications in an external program, and then import them back into your project.

提交回复
热议问题