手动从一个RESX资源价值? [英] Manually retrieve a resource value from a resx?

查看:108
本文介绍了手动从一个RESX资源价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是在所有可能获得来自未设置为当前用户的文化资源文件中的值?我们的应用程序的数据为基础的反对文化为主。

Is it at all possible to get the value from a resource file that is not set to the current user's culture? Our application is data-based opposed to culture-based.

例如。一个文件是法国文件和特定的标签和字段需要更新,并与新的数据替换。

e.g. a document is a French document and specific labels and fields need to be updated and replaced with new data.

可以在资源管理器指示使用,而不是默认的.resx法国的.resx?

Can the resource manager be instructed to use a French .resx instead of the default .resx?

推荐答案

您可以使用的 ResourceManager.GetString()的方法,并提供所需的培养作为参数:

You can use the ResourceManager.GetString() method and provide the desired culture as a parameter:

var culture = CultureInfo.CreateSpecificCulture("fr-FR");
var localizedString = ResourceManager.GetString("labelName", culture);

这篇关于手动从一个RESX资源价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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