如何使用 innosetup 从 属性 文件中读取值?
How to read values from property file using innosetup?
我正在尝试从 demo.properties 文件中读取值 innnosetup.Here 是我的 demo.properties 文件 hibernate.connection.username=James
hibernate.connection.password=Jack
hibernate.connection.url=jdbc:jtds:sqlserver://8080/clientDB
hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
我想阅读此文件并在用户界面中将值显示为 James、Jack 和 8080。
谁能指导我如何只获取那些特定的值?
这里有一份指南:
- 在
[code]
部分使用 Pascal-Script
- 与
LoadStringsFromFile()
(http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_loadstringsfromfile) 一起获取文件内容。
- 使用
for
循环遍历这些行
- 用
Pos()
(http://www.jrsoftware.org/ishelp/topic_isxfunc_pos.htm)求出=
符号的位置
- Use
Copy()
(http://www.jrsoftware.org/ishelp/topic_isxfunc_copy.htm) 使用=
的位置从当前行提取key和value
如果您需要更多功能,请看这里:http://www.jrsoftware.org/ishelp/index.php?topic=scriptfunctions
这里解决了一个与您很接近的问题:Find and read specific string from config file with Pascal Script in Inno Setup
我正在尝试从 demo.properties 文件中读取值 innnosetup.Here 是我的 demo.properties 文件 hibernate.connection.username=James
hibernate.connection.password=Jack
hibernate.connection.url=jdbc:jtds:sqlserver://8080/clientDB
hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
我想阅读此文件并在用户界面中将值显示为 James、Jack 和 8080。
谁能指导我如何只获取那些特定的值?
这里有一份指南:
- 在
[code]
部分使用 Pascal-Script - 与
LoadStringsFromFile()
(http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_loadstringsfromfile) 一起获取文件内容。 - 使用
for
循环遍历这些行 - 用
Pos()
(http://www.jrsoftware.org/ishelp/topic_isxfunc_pos.htm)求出=
符号的位置 - Use
Copy()
(http://www.jrsoftware.org/ishelp/topic_isxfunc_copy.htm) 使用=
的位置从当前行提取key和value
如果您需要更多功能,请看这里:http://www.jrsoftware.org/ishelp/index.php?topic=scriptfunctions
这里解决了一个与您很接近的问题:Find and read specific string from config file with Pascal Script in Inno Setup