是字符串资源(的.resx)属性保存在内存中? [英] Are string resources (.resx) properties kept in memory?

查看:205
本文介绍了是字符串资源(的.resx)属性保存在内存中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个资源(的.resx)文件,并且它具有目前58字符串属性。这一数额字符串属性可以长..

I have a resource (.resx) file, and it have currently 58 string properties. This amount of string properties can grow..

我的疑问是,在这些字符串保存在内存中?如果我有200个,都将被保存在内存中? 还是字符串保存在文件和ResourceManager的访问文件?还是别的什么?如何工作的呢?

My doubt is, are those strings kept in memory? If i have 200, will all be kept in memory? Or the the strings are kept in file and the ResourceManager access the file? Or anything else? How this work?

推荐答案

一般.resx文件编译成的.resources与resgen.exe文件,并作为大会本身的程序集的资源存储。如果你看一下在Visual Studio项目中的ResX文件的属性,你会看到生成操作嵌入的资源,这是什么使它成为嵌入到程序集。因此,组件加载任何时候你都会加载资源文件中。可能有另一种方法来使用的资源文件不保留在内存中,但,这是它们的使用正常方式。

Generally the .resx file is compiled into a .resources with resgen.exe file and stored as an assembly resource within the assembly itself. If you look at the properties of the ResX file in your Visual Studio project, you'll see that the Build Action is Embedded Resource, which is what causes it to become embedded into the assembly. So any time the assembly is loaded you will load the resource file as well. There might be another way to use resource files that does not keep them in memory but this is the normal way they are used.

这篇关于是字符串资源(的.resx)属性保存在内存中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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