I have created an ASP.NET Server Control and have it working just fine. However, I have decided that I now need to embed many, many images into the DLL rather than having them be required in local paths wherever the DLL is used.
To my horror I just discovered that doing this is a manual job where I have to go into hundreds of folders and subfolders and specify that I want those files to be embedded. I then have to change all of my markup to read these images and files via the WebResourceAttribute which is a chore to say the least.
My 2 questions:
Assuming your images are already included in the web project, you might consider writing a Visual Studio macro to traverse your project folder structure and embed all the images. If they aren't, you can still do the same thing by using the System.IO.Directory
class.
To get the right macro code to embed the image, turn the macro recording feature on and embed a couple of images. That should cause the right macro code to be generated. (Assuming this can be done with a macro, of course.)
Yes, you can definitely do this. Try the Find in Files feature of VS and use the Replace option.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.