资源(.resx)文件有什么好处? [英] What are the benefits of resource(.resx) files?
问题描述
使用它们有哪些令人信服的理由?
What compelling reasons exist for using them?
推荐答案
资源文件通过根据用户的区域设置自动确定要使用的语言 resx 文件,为您提供了一种本地化/国际化 .net 应用程序的简单方法.要添加更多语言,只需添加另一个已翻译的资源文件.
Resource files give you an easy way to localize/internationalize your .net applications by automatically determining which language resx file to use based on the user's locale. To add more languages, simply add another translated resource file.
资源文件为您提供了一个中央位置来存储您的字符串、文件和脚本,并以强类型方式引用它们(因此如果您不正确地引用它们,编译就会中断).
Resource files give you a central location to store your strings, files and scripts and refer to them in a strongly-typed manner (so the compile will break if you reference them improperly).
资源文件可以编译为附属程序集,从而可以轻松更改生产应用程序中的资源,而无需重新编译整个程序.
Resource files can be compiled into satellite assemblies, making it easy to change up the resources in a production application without having to recompile the whole thing.
这篇关于资源(.resx)文件有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!