开发者

Getting filename of content file in Silverlight

开发者 https://www.devze.com 2023-03-23 10:00 出处:网络
I need to get the filename for a file linked with my Visual Studio project as \"Resource\", \"Embedded Resource\" or \"Content\" (doesn\'t matter which). How can I get the absolute or 开发者_如何学编程

I need to get the filename for a file linked with my Visual Studio project as "Resource", "Embedded Resource" or "Content" (doesn't matter which). How can I get the absolute or 开发者_如何学编程relative path for it? The problem is that my application runs with current directory "C:\Program Files\Microsoft Silverlight" (because it's OOB?!), so I can't just set the file to "Copy if newer" and use a filename relative to the assembly execution directory.


A resource embedded in your Silverlight application can't have a relative file path per se.

If you choose embedded resource or resource, the file will be embedded in the project dll as a resource.

If you choose "content", I think (but I am not entirely sure) that the file will be embedded in the XAP file of your Silverlight application.

Either case, it's in the application package (the XAP file) , and therefore isn't really reachable from outside.

0

精彩评论

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