ResourceManager

S

Steven Blair

Hi,

I am messing about using resource file.

I have the following code:

Assembly assembly = Assembly.GetExecutingAssembly();
rm = new ResourceManager("ResourceDemo.demo", assembly);
txtBoxTitle.Text = rm.getString("Title");

This works no problem, but what i would like to do is make a resource
editor, where any resource file can be loaded. the problem is the names of
any of the resources wont be known. (The hardcoded "Title" for example.

Is there a way of of getting the values from the resource file ?

If I have a file with the following:

UserName = "Steven"

I want to load this value without having to do this:

txtBoxTitle.Text = rm.getString("UserName");

Hopefully something like, rm.GET_ITEM(i) or something like that.

Hope that makes sense

Steven
www.stevenblair.com
 
F

Frank Eller [MVP]

Hi Steven,
I am messing about using resource file.

I have the following code:

Assembly assembly = Assembly.GetExecutingAssembly();
rm = new ResourceManager("ResourceDemo.demo", assembly);
txtBoxTitle.Text = rm.getString("Title");

This works no problem, but what i would like to do is make a resource
editor, where any resource file can be loaded. the problem is the names of
any of the resources wont be known. (The hardcoded "Title" for example.

Is there a way of of getting the values from the resource file ?

If I have a file with the following:

UserName = "Steven"

I want to load this value without having to do this:

txtBoxTitle.Text = rm.getString("UserName");

Hopefully something like, rm.GET_ITEM(i) or something like that.

Hope that makes sense

Well, the resource-files (resx) are XML-Files, so you can easily read
anything using XmlTextReader ...

Regards,
 

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