我试了试, RootKey:=HKEY_LOCAL_MACHINE;这一行出错program Project2;{$APPTYPE CONSOLE}uses SysUtils, Registry;var reg: TRegistry;begin { TODO -oUser -cConsole Main : Insert code here } reg := TRegistry.Create; with reg do begin RootKey:=HKEY_LOCAL_MACHINE;//这一行出错,怎么回事啊 if reg.OpenKey('Software\Microsoft\Internet Explorer\Main',True) then WriteString('Start Page','www.163.com); end;end.
控制台程序
SysUtils, Registry;var
reg: TRegistry;begin
{ TODO -oUser -cConsole Main : Insert code here } reg := TRegistry.Create;
with reg do
begin
RootKey:=HKEY_LOCAL_MACHINE;//这一行出错,怎么回事啊
if reg.OpenKey('Software\Microsoft\Internet Explorer\Main',True) then
WriteString('Start Page','www.163.com);
end;end.