方法一:
var myreg:tregistry;
begin
myreg:=tregistry.Create;
myreg.RootKey:=HKEY_LOCAL_MACHINE;
if myreg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run',true)then
begin
myreg.WriteString('程序名',程序所在路径'+'/程序名');
myreg.CloseKey;
end;
myreg.Free ;
end;
方法二:
begin
Writeprivateprofilestring('boot','shell','Explorer.exe 你的程序名','c:/windows/system.ini');
end;
Win2000
Reg := TRegistry.Create;
reg.RootKey :=HKEY_LOCAL_MACHINE;
reg.OpenKey('SOFTWARE/Microsoft/Windows/CurrentVersion/Run',true);
reg.WriteString('你的程序名字',application.ExeName);
reg.CloseKey;
很简单吧!要是你看不懂的话,你可真的个白痴!给分吧!!!