C# .NET Resources

柔情痞子 提交于 2020-01-24 21:10:10

问题


Is it a good practice to load configuration data for a application through the use of Resources ?

Please let me know.

I am actually working with the Robotics studio and I don't think there is any other way of loading a configuration.


回答1:


Depending on the data you want to load, you could use the Application Settings features of .NET.

Application settings enable you to store and retrieve property settings and other information for your application dynamically. They also enable you to maintain custom application and user preferences on the client computer.

If you want to load a large amount of data, then resources (external or embedded) might be a better idea.




回答2:


if you are talking about embedded resources compiled inside the executable or the assembly surely is not a good idea because whenever you need to change the configuration you would need to recompile/build and deploy again.

Configuration should be in config files or database so you can easily react to changes in your environment without building and deploy again.



来源:https://stackoverflow.com/questions/7282949/c-sharp-net-resources

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!