Resource File (.resx) does not show changes??

  • Thread starter Thread starter al
  • Start date Start date
A

al

Hi,

I use a resource file (.resx) to store user's settings such as
language and other strings. The problem i'm facing is that when the
user changes one of the strings in the resource file, those changes
are shown by VB.NET untill after the user reloads the app.

Is there any work-around for this behavior so changes can appear
without relaoding the app??

Thanks,
Grawsha
 
Hi

Are you using ResXResourceReader class for reading resource file. If not try
that class for reading resource file. You can edit the resx file when you run
the application. You dont need to restart the application to read the
modified entries.

Regards

Sooraj
Microsoft Community Star
 
Sooraj PM said:
Hi

Are you using ResXResourceReader class for reading resource file. If not try
that class for reading resource file. You can edit the resx file when you run
the application. You dont need to restart the application to read the
modified entries.

Regards

Sooraj
Microsoft Community Star


Thanks Sooraj,

will you please provide an example on how to move in the resource file
using ResXResourceReader?

MTIA,
Grawsha
 
Hi

Create the resource file (You can create the resource file by 1. Assign the
keys and values in a text file save the same. 2 using the RESGEN.EXE you can
create the .Resx or .resources file from this text file)

Add the resource file to the project

Code for Listing the keys and values of Resource file:

Dim rsxr As ResXResourceReader
rsxr = New ResXResourceReader("..\txtResource.resx") ' Tha path of resource
file
Dim d As DictionaryEntry
For Each d In rsxr
MessageBox.Show(String.Format("{0}: {1}", d.Key.ToString(),
d.Value.ToString()))
Next d

rsxr.Close()'Close the reader.

Hope this will help you

Regards
Sooraj
Microsoft Community Star
 

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

Back
Top