Greatchap
Greatchap

Reputation: 382

Get Embedded Resource

I have a zip file and I added it to my program's resource folder. I set the properties to embedded resource.

Now when I type my.resources. ...in the list the name of that file does not come but other image files comes.

I want to extract the zip file to a folder at runtime. I have done that before if I add zip file to my solution. But if the zip file is added into my resources folder (right click in resources, add, existing item) then how to get it from there.

Help will be appreciated. My program is written in vb.net 2008.

Cheers, GR

Upvotes: 3

Views: 4240

Answers (2)

hungryMind
hungryMind

Reputation: 6999

Modify the property of added resource in solution explorer to "Embedded Resource"

Upvotes: 0

Alex Aza
Alex Aza

Reputation: 78457

You need to add the file as a typed resource. Adding file just to Resources folder does not generate resource wrapper property.

enter image description here

Then you can reference the file content by

Dim fileConent As Byte() = My.Resources.FileName

Replace the FileName with your file name. Intellisense will guide you.

Upvotes: 6

Related Questions