以编程方式更改资源文件值 [英] change resources files values programatically

查看:73
本文介绍了以编程方式更改资源文件值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有三种语言,网站上所有页面的内容都来自

resx文件(index.resx,index.ar-JO,index.ru-RU )我想动态地更改这些资源文件的值。所以管理员可以更改这三个文件的值...我想知道如何做到这一点..谢谢你

Hi,i have website which have three languages,all content of the pages on the website are come from
resx files(index.resx,index.ar-JO,index.ru-RU) and i want to change the value of theses resources files dynamically..so the admin can change the value of the three files...i want to know how to do that..thank you

推荐答案

RESX文件只是普通的XML文件,因此您可以使用任何现有的XML技术(或者更可能是内置的RESX文件编写器)来修改它们。但是,如果您希望更改文件然后在本地化应用程序中查看更改,那么它将无法正常工作。在编译期间,RESX文件将编译为程序集内的资源。在本地化应用程序时加载这些资源。更新资源的唯一方法是重新编译。



更多信息:以编程方式修改资源文件(.resx)



我希望这会对你有所帮助。
RESX files are just normal XML files so you can modify them using any existing XML technology (or more likely the built in RESX file writer). But if you're expecting to change the file and then see the changes in a localized application then it won't work. RESX files are compiled down to resources inside an assembly during compilation. It is these resources that are loaded when you localize an application. The only way to update the resource is to recompile.

For more info : Modify Resource File (.resx) programmatically

I hope this will help to you.


这篇关于以编程方式更改资源文件值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆