locked
Modifying the Resources Files from Code behind? RRS feed

  • Question

  • User-220297608 posted

    hi all,

     i have a Webproject that is developed using ASP.Net 2.0 and i am using Localization for it using a Global resource file.
     my question is: i want to change the values of the Resource files .resx programmatically from the code behind file, i don't want to go the the .resx file manually and look for the string i want to change then change it by hand. because my project is hosted on a web server and it takes a long time to download the file (.resx) , change it and then upload it again. its better if i just made a page in the administrator menu to directly change the resources i want.

     

    Thanky you for your time,

    Mostafa Adel

    Development Team Leader
     

    Sunday, October 29, 2006 8:50 AM

Answers

All replies

  • User1439985827 posted

    you can use the ResXResourceWriter in the System.Resources namespace.

    http://msdn.microsoft.com/en-us/library/system.resources.resxresourcewriter.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, October 29, 2006 3:49 PM
  • User-220297608 posted

    thank you for your reply but there is another problem, the resxresourcewriter writes a new file to the application, it doesnot modify the existing one.

    so is there a way to use it to modify an already existing resource file 

    Monday, October 30, 2006 7:21 AM
  • User-1936818034 posted
    What resource files conatin are just xml formatted name/value pairs. So, why not just try open it as an XmlDocument and modify?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 31, 2006 2:10 AM