How to change the contents of a Resources files programmatically

Logiciel Auto-Caisse, Inc 61 Reputation points
2022-02-20T13:30:18.343+00:00

Hi everyone,
I have 2 resx files:

C:\AutoCashRegister\Resources\Languages\Resources.en-US.resx
C:\AutoCashRegister\Resources\Languages\Resources.fr-FR.resx

I use these 2 for translate from English to French.
In these files all keys are easy to see where the text is stored, for example, FrmStartup_Dept11 is the 11 row of the departments table.

I want to be able to change the value of the key (highlighted in yellow), in that case FrmStartup_Dept11
so when a user change the name in the form department to "Department of transportation",
then the FrmStartup_Dept11 take that name and another Resource file name Resources.fr-FR.resx will also change
because when a user change a department name, he has to but the French translation as well to be validated.

English: "Department of transportation"
French: "Departement de transport"

Note: I control the translation with Resources.???? files, now I need to be able to edit these files programmatically.
Any idea?

Thanks

Claude

176089-frmstartup.jpg176164-resources-files.jpg

Developer technologies | VB
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2022-02-20T14:41:06.417+00:00

    You can use
    ResXResourceReader
    and
    ResXResourceWriter
    to read/re-write resources from a .resx file

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.