procedure TForm1.Mod_btnClick(Sender: TObject);
   var
     Directory: string;
     WorkPath: String;
     SearchRec: TSearchRec;
     i:integer;
begin
  Mod_LBx.Visible:=true;
   WorkPath := ExtractFilePath(Application.ExeName);
   if WorkPath[Length(WorkPath)] <> '\' then WorkPath := WorkPath + '\';
   Directory:=WorkPath+'模板\';
   if DirectoryExists(Directory) then
      if FindFirst(Directory,faDirectory,SearchRec) = 0 then
         while FindNext(SearchRec) = 0 do
           begin
              if (SearchRec.Attr and faAnyFile)<>0  then      //任何文件
              if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') and (GetFileExpName(UpperCase(SearchRec.Name))<>'模板') then
                begin                                         
                   Mod_LBx.Items.Add(SearchRec.Name);
                end;
          end;
          FindClose(SearchRec);
end;  procedure TForm1.GetFileExpName(FileName: ShortString);
  var DotPos: Integer;
  begin
    DotPos := Pos('.',FileName);
    if DotPos>0 then
      Result := UpperCase(Copy(FileName,DotPos+1,Length(FileName)-DotPos));
  end;  procedure TForm1.ModCBtnClick(Sender: TObject);
  begin
   Mod_LBx.Visible:=false;
end;