Perlia Lana
Perlia Lana

Reputation: 11

View content of a .resource file

I have a .NET executable and I need to view the resources attached to it. I extracted .resource file from .NET executable using DotNetResourcesExtract utility but I don't now how to view content of .resource file.

Could someone explain how to view this file?

Upvotes: 1

Views: 7055

Answers (2)

Viktor Wolf
Viktor Wolf

Reputation: 133

According to MSDN The .resx (XML-based resource format) files are converted into common language runtime binary .resources files that can be embedded in a runtime binary executable or compiled into satellite assemblies.

Getting to the point: How to view this? Well, Since it's a binary file which contains resource(images etc.) therefore you could always use Windows resources editing/extracting applications. eg. Restorator, Resource Hacker to name a few.

Meanwhile, have look at this Stackoverflow post. which sound almost similar.

Upvotes: 1

Scott
Scott

Reputation: 180

Not sure you're using it correctly...

Assuming your storing images there.

You can simply do:

Image resfile = ProjectName.Properties.Resources.resourceName;

So if resfile is an image, you can put it into an Image control.

so, if you have an image control on your form you can simply do: imageControl.Image = ProjectName.Properties.Resources.resourceName;

If it's a text file or any other type of file - again, you can access it the same way. If it's a binary file, the ProjectName.Properties.Resources.resourceName will be a byte array, so you 'll need to load it in the correct manner.

Is that what you're wanting? Otherwise indicate what type of file are you trying to extract from your resource file.

Upvotes: 1

Related Questions