标准的Windows .ini文件允许评论吗? [英] Do standard windows .ini files allow comments?

查看:95
本文介绍了标准的Windows .ini文件允许评论吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows ini文件中是否允许注释? (...假设您使用 GetPrivateProfileString api函数读取...)

Are comments allowed in Windows ini files? (...assuming you're using the GetPrivateProfileString api functions to read them...)

[Section]
Name=Value   ; comment

; full line comment

并且,在任何地方都有适当的.INI文件格式吗?

And, is there a proper spec of the .INI file format anywhere?

感谢回复 - 但也许我不够清楚。它只是我感兴趣的 Windows API调用读取的格式。我知道其他实现允许评论,但它具体是我需要知道的MS Windows规范和实现。

Thanks for the replies - However maybe I wasn't clear enough. It's only the format as read by Windows API Calls that I'm interested in. I know other implementations allow comments, but it's specifically the MS Windows spec and implementation that I need to know about.

推荐答案

我在INI文件中看到过注释,所以是参考Wikipedia文章 http://en.wikipedia.org/wiki/INI_file ,似乎没有一个正式的规范,我可以找到,但这是

I have seen comments in INI files, so yes refer to the Wikipedia article at http://en.wikipedia.org/wiki/INI_file, there does not seem to be an official specification that I could find, but that is the correct syntax for comments, as many Game INI files had this as I remember.

编辑

API返回值和注释(忘记在我的回复中提到这一点),只是构造和示例INI文件,并调用此API(有注释),你可以看到如何返回。

The API returns the Value and the Comment (forgot to mention this in my reply), just construct and example INI file and call the API on this (with comments) and you can see how this is returned.

这篇关于标准的Windows .ini文件允许评论吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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