我有以下 JSON:
{
"Info": {
"User": 2,
"String": "foo"
}
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,TLama 的 Inno JSON 配置库不适用于 JSON 字符串,而只能用于 json 文件。
我尝试使用 JSON 字符串而不是 json 文件的路径,但没有用。
if JSONQueryInteger('{"Info":{"User":2,"String":"foo"}}', 'Info', 'User', 0, IntValue) then
MsgBox('User=' + IntToStr(IntValue), mbInformation, MB_OK);
Run Code Online (Sandbox Code Playgroud)
我知道我可以将我的 JSON 保存到一个文件然后解析它,但它看起来有点混乱。
如何在 Inno Setup 中解析 JSON 字符串?