如何使用C#读取资源文件? [英] How to read the Resource File using C#?

查看:89
本文介绍了如何使用C#读取资源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序,应该本地化为3种语言。所有控件都从该语言的Resx文件中获取控件文本。现在,如果我们有一条消息,可以显示针对该特定文化的自定义错误消息。所以为此,我创建了一个单独的Foldere作为资源,并创建了一个resx作为DialogMessages.ar-IQ.resx。



如何阅读 DialogMessages.ar-IQ.resx 在C#中?



我试图使用ResxResourceReader类读取文件。这是一个正确的过程还是存在任何缺陷?

解决方案

检查

http://stackoverflow.com/questions/1508570/read-string-from-resx-file-in-c-sharp [ ^

I have a web application which should be Localized to 3 languages. All the controls are taking the control text from the Resx file of that language. Now I have scenario like suppose if we have a messages,custom error messages to show for that particular culture. So for this I have created a seperate Foldere as "Resources" and created a resx as "DialogMessages.ar-IQ.resx".

How can I read the "DialogMessages.ar-IQ.resx" in C# ?

I have tried to read the file using ResxResourceReader class. Is this a correct process or any flaw exists ?

解决方案

check
http://stackoverflow.com/questions/1508570/read-string-from-resx-file-in-c-sharp[^]


这篇关于如何使用C#读取资源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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