tags:

views:

136

answers:

1

Is there a way to check in code if a resource exists at an Uri such as:

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

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.

Foovanadil
Huh, since when does File.Exists look into the executing assembly's resources?
Isak Savo