gpt4 book ai didi

registry - 将值写入 Inno Setup 中存储在数组中的所有注册表项

转载 作者:行者123 更新时间:2023-12-04 08:23:35 25 4
gpt4 key购买 nike

我见过这个 https://jrsoftware.org/ishelp/index.php?topic=registrysection但这不是动态的。
我读取了在注册表中找到的值,它们可以是事物的组合。并非所有客户端都拥有所有组合,因此我需要根据其系统中的内容创建注册表子项。我可以毫无问题地在子项下创建值:

for i := 0 to GetArrayLength(myArrayOfStrings) - 1 do
begin
if myArrayOfStrings[i] = 'client has this item' then begin
RegWriteStringValue(HKLM64 , 'SOFTWARE\SomeSubkey',
'New Value', 'im in the registry');
end;
end;
我想要做的是根据变量 myArrayOfStrings 中的值在注册表中创建一个新的子项.
if not myArrayOfStrings[i] = 'client has this item' then begin
//Create new subkey called the value in myArrayOfStrings[i]
//then add values to the newly created subkey
end;
我怎么做?谢谢

最佳答案

只需使用 myArrayOfStrings[I] 的值在关键路径中:

var
Key: string;
I: Integer;
begin
// ...
for I := 0 to GetArrayLength(myArrayOfStrings) - 1 do
begin
Key := 'SOFTWARE\SomeSubkey\' + myArrayOfStrings[I];
RegWriteStringValue(HKLM64, Key, 'New Value 1', 'value 1');
RegWriteStringValue(HKLM64, Key, 'New Value 2', 'value 2');
// ...
end;
end;

关于registry - 将值写入 Inno Setup 中存储在数组中的所有注册表项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65382440/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com