<分区>
Possible Duplicate:
Reading/writing INI file in C#
有哪些方法或 C# 库可以执行以下操作?谢谢
//Delphi read item in a given section of a binary file.
uses iniFiles;
readString('SectionName','itemName','DefaultValueIfNotFound');
<分区>
Possible Duplicate:
Reading/writing INI file in C#
有哪些方法或 C# 库可以执行以下操作?谢谢
//Delphi read item in a given section of a binary file.
uses iniFiles;
readString('SectionName','itemName','DefaultValueIfNotFound');
最佳答案
框架中没有用于直接读取 INI 文件的类,因为它们现在并不是一个好的选择。相反,通常建议您使用 Application Settings infrastructure或其他更灵活的技术,例如将信息保存在 XML 文件或数据库中。
不过很多人都写了自己的库,比如this one on CodeProject ,这将使您能够轻松地从 C# 中的 ini 文件的一部分中读取值。
关于C# 等效于 Delphi 的 .INI 读取方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8435807/
相关文章:
c# - 循环中定义的 Linq 表达式的范围 - 问题 : closing over loop variable
html - Delphi - 是否有适用于 VCL/FMX 应用程序的所见即所得 HTML 编辑器组件?
delphi - 传输到 ClientDataset 时的字符串截断
c# - 使用 GDI+ 绘制内容时如何使用 AutoScrollbar
c# - .NET MySQL 连接器冲突的 DbProviderFactories
multithreading - 套接字 : how execute two threads simultaneously without stop?