100分问关于uri使用某个dll image 资源的问题?急,在线等.....分不够可以再加多少都可以

yzxandfcm 2007-09-06 10:47:05
我看到"Windows.Presentation.Foundation.Unleashed.Dec.2006.pdf"中提到关于uri的用法,如下:
"MyDll;Component/logo.jpg"
Embedded in a different assembly called MyDll.dll or MyDll.exe

"MyDll;Component/A/B/logo.jpg"
Embedded in a different assembly called MyDll.dll or MyDll.exe using an internal subfolder structure (A\B) defined at compile time

后面又描述了它的格式:
Accessing Resources Embedded in Another Assembly
The ability to easily access binary resources embedded in another assembly is very handy
(and gives you more options for updating resources without needing to replace the main
executable), but the syntax is a little bizarre. As Table 8.1 implies, the syntax is
AssemblyReference;Component/ResourceName

///////////////////////////////////////////////////////////////////////////

我在我的工程中新建了一个dll工程"dllProject" ,并加入了一些image.

在使用uri的中程中引用的dllProject,并使用了下面的语句去调用image资源:

bmpImg.UriSource = new Uri("AcpResource;Component/add.bmp");

但每次运行到这里就报异常,请问是什么问题,请高手们指点一下!先谢了!

...全文
90 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yzxandfcm 2007-09-06
  • 打赏
  • 举报
回复
没人啊,晕......
yzxandfcm 2007-09-06
  • 打赏
  • 举报
回复
没人知道吗?
yzxandfcm 2007-09-06
  • 打赏
  • 举报
回复
在线等.......

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧