使用TiniFile类编写带注释行的INI文件 [英] Write INI files with comment lines using TiniFile class

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

问题描述

我可以使用Delphi中的 TIniFile 类以任何方式将注释写入INI文件吗?

Can I use the TIniFile class from Delphi in any way to write comments to my INI files ?

[VALUES]
; first number
a=5
; something else
b=25
...
...

在网上找到的示例(示例)有时添加了一些不错的注释行,但未显示如何创建,阅读和编​​写这些行....

In the examples (EXAMPLE) I found on the web there are sometimes nice comment lines added, but not shown how to create, read , write these lines ....

推荐答案

TIniFile类是提供INI文件服务的Windows API函数的松散包装.该API不支持编写注释,因此TIniFile也不能这样做.

The TIniFile class is a loose wrapper around the Windows API functions the provide INI file services. That API does not support writing comments and so TIniFile cannot do so either.

如果要发出带有注释的文件,则必须找到其他INI文件库,或者自己滚动.

If you want to emit files with comments, you will have to find a different INI file library, or roll your own.

这篇关于使用TiniFile类编写带注释行的INI文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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