开发者

Check if a packed resource exists in WPF

Is there a way to check in code if a resource exists at an Uri su开发者_运维技巧ch as:

"pack://application:,,,/MyResource.jpg"


Just chop off the pack://application:,,,/ part of the string and do a File.Exists on the remaining part of the path.

Your snippet you posted is pointing to a file that lives in the root of the running application and is called MyResource.jpg.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜