读/写INI文件 [英] Reading/writing an INI file

查看:159
本文介绍了读/写INI文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有类在.NET框架,可以读/写标准的.ini文件:

Is there any class in the .NET framework that can read/write standard .ini files:

[Section]
<keyname>=<value>
...

德尔福的 TIniFile 分量,我想知道是否有任何类似的C#?

Delphi has the TIniFile component and I want to know if there is anything similar for C#?

推荐答案

在.NET框架的创建者希望您使用基于XML的配置文件,而不是INI文件。因此,没有,没有内建机制阅读。

The creators of the .NET framework want you to use XML-based config files, rather than ini files. So no, there is no builtin mechanism for reading them.

有可用的第三方解决方案,但。看看 rel="nofollow"> INI文件处理类。

There are third party solutions available though. Take a look at An INI file handling class using C#.

这篇关于读/写INI文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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