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.
我导出了一个项目,它使用一些文件作为图标,作为一个类库。现在,当我在另一个项目中使用该库时,无法找到这些图标。如何以即使在使用该库的项目中也可以使用它们的方式导出它?
谢谢和问候, 罗希特
将图标添加到库项目并将它们标记为Embedded Resource文件。然后使用Assembly.GetManifestResourceStream(...)函数读取它们。
Embedded Resource
Assembly.GetManifestResourceStream(...)
如果您使用资源设计器创建资源,请打开设计器并将“访问修饰符”组合从“内部”更改为“公共”。