INI样式的配置文件可能具有类似于以下的格式:
[heading1]
key1=value
key2=value
[heading2]
a=1
b=2
etc...
Run Code Online (Sandbox Code Playgroud)
conf风格的配置文件更加多样化。它们可能类似于:
# A comment
button 1 {
name "hello"
"text" hi.there
"more..." {
"something 123" bla.bla "123"
}
}
# Another comment
button 2 {
# hello
x=2
}
Run Code Online (Sandbox Code Playgroud)
或者可能有点像这样:
# set server port
server.port = 1234
# make everything go faster
machine.turbo_button = activated
Run Code Online (Sandbox Code Playgroud)
在 Mac、Linux 和 BSD 上,所有风格的配置文件通常都有 UNIX 风格的行尾,而在 Windows 上可能会多一些。.ini
Windows 上的文件通常具有 DOS/Windows 风格的行尾。