.NET 'Old' Resource access ?????

N

Nadav

Hi,

I wonder... How one should use C# to access resource data
stored in an EXE (8086*) binary ??? ( VC6 .rc resource
data )?
Can the ResourceManager be used to extract this type of
data?

Any directions/samples/pointers will be appriciated.

Thanks in advance,
Nadav,
Sofin l.t.d.
Look at a great new tool I have developed at:
http://www.ddevel.com/home/main.asp
 
R

Ralph Gerbig

Hi,
if you have a embeded resource in your assembly you can use the following
code:
Assembly asm = Assembly.GetExecutingAssembly();

Stream s =
asm.GetManifestResourceStream("namespace.folderinyourproject(optional).filen
ame");

Here is an example for using a gif pictutre which was embeded:
Assembly asm = Assembly.GetExecutingAssembly();

Stream s = asm.GetManifestResourceStream("e_Bay_Manager.Icons.about
Image.gif");

Bitmap img = new Bitmap (s);

hope this helps.
--
Mit freundlichen Grüßen -- Regards

Ralph Gerbig
www.ralphgerbig.de.vu
(e-mail address removed)
 
C

Conrad Zhang

There is no direct way in framework. You have to P/Invoke.

Actually what I am tring to do is to get an icon from an
external binary Executable ( e.g. the icon of
regedit.exe ), in C++ I would use LoadLibrary and
LoadIcon to achine this task, how should I do it in C#?
Is there any collection class that handle this kind of
scenario ???

I am really tring to avoid calling Win32 API directly
from C# ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top