节省少量配置的最佳方法 [英] Best way to save low amount of configuration

查看:23
本文介绍了节省少量配置的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须保存我的设备配置,一位朋友告诉我,因为它只有 2(两个)字段,最好在 .txt 文件 上保存/读取它创建一个表.是真的吗?
它会更快吗?或者没关系?
如果是这样,我该怎么做?
我知道如何使用 System.IOStreamReader/StreeamWriter 在文本文件上Write/Read.
我只是想知道它是否真的会更快,以及如何读取它并将读取的值设置为配置的想法......也许使用数组并使用 Split ?

I have to save the configuration of my device, and a friend told me that as it is just 2(two) fields, it would be better save/read it on a .txt file instead create a table. Is that true ?
Will it be quite faster? Or doesn't matter ?
If so, how may I do that?
I know how to Write/Read on text file using System.IO and StreamReader/StreeamWriter.
I just wanted to know if it is true that it would be faster and an idea of how could I read it and set the value read to the configuration.... Maybe using array and use Split ?

推荐答案

从性能的角度来看,这并不重要,所以不要自己动手,只需使用内置的 C# properties/app.config 实现即可.

It shouldn't really matter from a performance perspective, so don't roll your own just use the built in C# properties/app.config implementation.

这篇关于节省少量配置的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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