Copying entire embedded resource subfolder

psychkiku

New member
Joined
Sep 6, 2010
Messages
2
Programming Experience
Beginner
Hi,

Please forgive my ignorance as I am reasonably new to VB but not to programming.
I have an exe which I am wanting to deploy to my userbase. I have a bunch of embedded resources which are used throughout the application and they work fine.

What I need help with is copying an entire subfolder of embedded resources to a specified directory on the local machine.

So to help explain it:

My resources tree looks similar to this....

Resources
----- Names (sub folder)
file1 (within Names)
file2 (within Names)
file3 (within Names)
folder1 (within Names)
file4 (within folder1)
----- Address (sub folder)
file1 (within Address)

So I need to copy the entire subfolder (keeping its file structure) to a specified location.

Is this possible?

Thanks in advance.
 
There is no concept of a folder when it comes to resources. The tree you see in the Solution Explorer is only how the source files are organised in your project. Resources are not files so you cannot treat them as files. They are binary data that form part of your executable. Try running this code to see for yourself:
VB.NET:
For Each resourceName In Assembly.GetExecutingAssembly().GetManifestResourceNames()
    MessageBox.Show(resourceName)
Next
If you want folders then write code to create folders. Extract each resource and save it to a file in whatever location you want.
 
Thats what I was afraid of.

I was certain that the way you described it was the way I was going to have to do it.

Thanks for the reply.
 
Back
Top