Can I find a good example of using resource file? 
Author Message
 Can I find a good example of using resource file?

Hi,all:

    I'm puzzled about the .Net resource...

    When I finishe a .ResX file, how can I compile it? Can I compile it into
a PE file? And how can I get the resources from the PE file?

    I've read the MSDN Lib about ResManager and such topics, but still
confused... heh, I'm too old to learn a new language now...

    :(

    So where can I get a good example,just a small tip maybe be my
salvation...



Sun, 04 Jul 2004 10:33:18 GMT  
 Can I find a good example of using resource file?
try this: csc /res:[your resource file] [your source code file], this
command can add resource to your program.



Quote:
> Hi,all:

>     I'm puzzled about the .Net resource...

>     When I finishe a .ResX file, how can I compile it? Can I compile it
into
> a PE file? And how can I get the resources from the PE file?

>     I've read the MSDN Lib about ResManager and such topics, but still
> confused... heh, I'm too old to learn a new language now...

>     :(

>     So where can I get a good example,just a small tip maybe be my
> salvation...



Sun, 04 Jul 2004 09:50:37 GMT  
 Can I find a good example of using resource file?
using System.Relection;

using System.resources;

private ResourceManager GermanManager;

string answer;

Assembly GermanAssembly = Assembly.GetExecutingAssembly();

GermanManager = new ResourceManager("Lexicon.German",GermanAssembly);

answer = GermanManager.GetString("caption");

MessageBox.Show(answer);

Notes:

Lexicon = the namespace
German = the resource file (German.resx - embedded);
"caption" = a key in the resource file which when called by the get string
will return the value stored in the German.resx for the file.

Use Resgen.exe to create a resource or add it directly from the IDE .
e.g resgen Options.txt options.resx  --- at the command line.

Note that the file Options.txt must have entries like this:

    username = patrick

 etc to compile properly.

Hope this helps. There is a book callled Professional C# which is very
useful  check it out.


Quote:
> try this: csc /res:[your resource file] [your source code file], this
> command can add resource to your program.



> > Hi,all:

> >     I'm puzzled about the .Net resource...

> >     When I finishe a .ResX file, how can I compile it? Can I compile it
> into
> > a PE file? And how can I get the resources from the PE file?

> >     I've read the MSDN Lib about ResManager and such topics, but still
> > confused... heh, I'm too old to learn a new language now...

> >     :(

> >     So where can I get a good example,just a small tip maybe be my
> > salvation...



Sun, 04 Jul 2004 11:26:36 GMT  
 Can I find a good example of using resource file?
Cheers~    :)

Thanks a lot.



Sun, 04 Jul 2004 11:43:18 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Beginner [Q] Using Canned File Open/Save dialog

2. What is a good site to find example C++ programs

3. How to find out amount of free resources (gdi resources, handles, system resources)

4. 95 Find Files example code

5. Using Resource .RES files to stick .bmp's and .wav files into .exe

6. Using Open file dialog to find file

7. Where Can I Find Resource File (VC40XXX.DLL)?

8. Where Can I Find Resource File VC40XXX.DLL?

9. Cant find find AFX resource in debug mode

10. CTreeCtrl used for file and directory browsing example

11. Cant find find AFX resource in debug mode

12. How to add image into resource file using VS.NET

 

 
Powered by phpBB® Forum Software