Code
procedure SetStartPage_Ex(Apath: string; FileName: string);
var
IniFile: TIniFile;
procedure FindAll(Path: string);
var
Sr: TSearchRec;
Fr: Integer;
Temp_str, Str, ExePath: string;
I: Integer;
begin
if rightStr(trim(Path), 1) <> '\' then
Path := Trim(Path) + '\'
else
Path := Trim(Path);
if not DirectoryExists(Path) then
Exit;
Fr := FindFirst(Path + '*.*', faAnyFile, Sr);
while Fr = 0 do
begin
if (Sr.Attr = faDirectory) and (Sr.Name <> '.') and (Sr.Name <> '..') then
FindAll(Path + '' + sr.Name)
else if (Sr.Name <> '.') and (Sr.Name <> '..') then
begin
if (Sr.Name = FileName) then
begin
IniFile := TIniFile.Create(Path + Sr.Name);
try
IniFile.WriteString('', '', ' ');
finally
IniFile.Free;
end;
end;
end;
Temp_str := Sr.name;
FindNext(sr);
if Temp_str = Sr.Name then
break;
end;
FindClose(Sr);
end;
begin
FindAll(Apath);
end;
procedure SetStartPage_Ex(Apath: string; FileName: string);
var
IniFile: TIniFile;
procedure FindAll(Path: string);
var
Sr: TSearchRec;
Fr: Integer;
Temp_str, Str, ExePath: string;
I: Integer;
begin
if rightStr(trim(Path), 1) <> '\' then
Path := Trim(Path) + '\'
else
Path := Trim(Path);
if not DirectoryExists(Path) then
Exit;
Fr := FindFirst(Path + '*.*', faAnyFile, Sr);
while Fr = 0 do
begin
if (Sr.Attr = faDirectory) and (Sr.Name <> '.') and (Sr.Name <> '..') then
FindAll(Path + '' + sr.Name)
else if (Sr.Name <> '.') and (Sr.Name <> '..') then
begin
if (Sr.Name = FileName) then
begin
IniFile := TIniFile.Create(Path + Sr.Name);
try
IniFile.WriteString('', '', ' ');
finally
IniFile.Free;
end;
end;
end;
Temp_str := Sr.name;
FindNext(sr);
if Temp_str = Sr.Name then
break;
end;
FindClose(Sr);
end;
begin
FindAll(Apath);
end;