本文整理自网络,侵删。
procedure ServiceUpdateDescription(const ServiceName, Description: string);
var
reg: TRegistry;
begin
reg := TRegistry.Create;
try
with reg do begin
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('SYSTEM\CurrentControlSet\Services\' + ServiceName, False) then
begin
WriteString('Description', Description);
end;
CloseKey;
end;
finally
reg.Free;
end;
end;
相关阅读 >>
Delphi access violations 问题的解决之道
Delphi rest 服务器返回utf16编码转换成正常string
Delphi 遍历所有目录和子目录下的文件名(可按后缀名遍历)
更多相关阅读请进入《Delphi》频道 >>