本文整理自网络,侵删。
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 获取随机字符串的方法 thash.getrandomstring
Delphi try except语句 和 try finally语句用法以及区别
Delphi 消息实现窗口最小化,最大化,关闭(Delphi)
更多相关阅读请进入《Delphi》频道 >>