亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? filesearch.pas

?? 可以使用硬件指紋作為密鑰加密文件
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{****************************************************************************
 * Project : FileSearch library
 * Author  : Alexandre GAMBIER
 * Date    : 24/09/2002
 * Unit    : FileSearch
 * Prefixe :
 * Purpose : Search file & folder
 ****************************************************************************
 * Alexandre GAMBIER (24/09/2002) : File creation
 * Alexandre GAMBIER (26/09/2002) : Add Date Filter
 * Alexandre GAMBIER (27/09/2002) : Add Size Filter
 * Alexandre GAMBIER (14/10/2002) : 1/ Replace OnFileFined event
 *                                     with OnFileFound
 *                                  2/ Add ExcludeFilters
 *                                  3/ NbPathFounded >> NbPathFound
 *                                  4/ NbFilesFounded >> NbFilesFound
 * Alexandre GAMBIER (28/10/2002) : 1/ Add FoundInNbPath in the statistics
 *                                  2/ The LookForDirectory is not override
 *                                     by the LookForAnyFile
 *                                  3/ The Filter property is replace by
 *                                     the FileNames property which allow to
 *                                     select more filters
 *                                  4/ Add the OnAcceptFile event to allow
 *                                     user to decide if the must really
 *                                     be accept                             
 ****************************************************************************}


unit FileSearch;

interface

uses Windows, Classes, Sysutils, Masks;

type
  { Search Options }
  TSearchOptions = record
    IncludeSubfolder    : Boolean;    { Search in subfolders     }
    LookForReadOnlyFile : Boolean;    { Search for readonly file }
    LookForHiddenFile   : Boolean;    { Search for hidden file   }
    LookForSystemFile   : Boolean;    { Search for system file   }
    LookForDirectory    : Boolean;    { Search for folder        }
    LookForArchiveFile  : Boolean;    { Search for archive file  }
    LookForAnyFile      : Boolean;    { Search for any file      }
  end;

  { Type of Date filter access }
  TDateFilterAccessKind = (dfakCreatedFiles, dfakModifiedFiles, dfakOpenedFiles, dfakAnyFiles);

  { Type of date filter }
  TDateFilterKind = (dfkBetween, dfkBefore, dfkAfter, dfkSame);

  { Date Filter }
  TDateFilter = record
    FilterOnDate     : Boolean              ;   { Activate or not the  date filter }
    FilterAccessKind : TDateFilterAccessKind;   { King of access filter            }
    DateFilterKind   : TDateFilterKind      ;   { King of date filter              }
    FirstDate        : TDateTime            ;   { First date                       }
    SecondDate       : TDateTime            ;   { Second date                      }
  end;

  { Type of size filter }
  TSizeFilterKind = (sfkSmallerOrEqualTo, sfkBiggerOrEqualTo);

  { Size Filter }
  TSizeFilter = record
    FilterOnSize   : Boolean        ;   { Activate or not the size filter }
    SizeFilterKind : TSizeFilterKind;   { Kind of filter                  }
    Size           : Integer        ;   { Size to compare with            }
  end;


  { Date Informations }
  TFileTime = record
    CreationTime : SYSTEMTIME;    { The time the file was created }
    AccessTime   : SYSTEMTIME;    { The time the file was opened  }
    WriteTime    : SYSTEMTIME;    { The time the file was written }
  end;

  { File Informations }
  TFileInformations = record
    Name       : String   ;   { File name       }
    Path       : String   ;   { PathName        }
    Attributes : Integer  ;   { File attirbutes }
    Size       : Integer  ;   { Size            }
    Time       : TFileTime;   { Times access    }
  end;

  { Statistics }
  TStatistics = record
    NbFilesFound  : LongWord;     { Number of files found matching with serach criteria            }
    FoundInNbPath : LongWord;     { Count the in how many different path the files have been found }
    NbPathFound   : LongWord;     { Number of folders found matching with serach criteria          }
    TimeNeeded    : LongWord;     { Time needed by the search operation                            }
  end;

  { Event : OnFileFound > called when a file or a folder is found }
  TOnFileFound   = procedure (FileFound : TFileInformations) of object;

  { Even : OnChangeFolder > called when the search operation change the path }
  TOnChangeFolder = procedure (NewPath : String) of object;

  { Event : OnStatistics > called when search operation is finished }
  TOnStatistics = procedure (Stats : TStatistics) of object;

  { Event : OnAcceptFile > called when a file is about to be accept and the user can say yes or no }
  TOnAcceptFile = function (FileFound : TFileInformations) : Boolean of object;

  { TFileSearch class }
  TFileSearch = class(TObject)
    private

    protected
      { FileInformation functions }
      function GetFileInformations(Path : String; SearchInfos : TSearchRec) : TFileInformations;

      { Filter on attribute }
      function GetAttributeFilter : Integer;
      function IsAttributesOk(AttrToCheck : Integer) : Boolean;

      { Filter on date }
      function IsDateOk(FileInfos : TFileInformations) : Boolean;

      { Filter on Size }
      function IsSizeOk(FileInfos : TFileInformations; SizeFilter : TSizeFilter) : Boolean;

      { Include filter }
      function IsFileMatching(FileName : String) : Boolean;
      function IsAllFileMarkerPresents : Boolean;

      { Exclude Filter }
      function ExcludeFile(FileInfos : TFileInformations; Exclude : TStringList) : Boolean;

    public
      { Search criteria }
      SearchOptions : TSearchOptions;
      DateOptions   : TDateFilter   ;
      SizeOptions   : TSizeFilter   ;
      FileNames     : TStringList   ;
      RootPath      : String        ;
      { Exclude filter }
      ExcludeFilters : TStringList;
      { Events }
      OnFileFound    : TOnFileFound   ;
      OnChangeFolder : TOnChangeFolder;
      OnStatistics   : TOnStatistics  ;
      OnAcceptFile   : TOnAcceptFile  ;

      { Constructor & Destructor }
      constructor Create;
      destructor Destroy; override;

      { start search operation }
      function Search : Boolean;

  end;

implementation

{*****************************************************************************
 * Procedure : TFileSearch.Create
 * Purpose   : Constructor
 * Arguments : NONE
 * Result    : NONE
 *****************************************************************************
 * Alexandre GAMBIER (24/09/2002) : Creation
 *****************************************************************************}
constructor TFileSearch.Create;
begin
  inherited Create;

  { Initialize search options }
  SearchOptions.IncludeSubfolder    := False;
  SearchOptions.LookForReadOnlyFile := True ;
  SearchOptions.LookForHiddenFile   := True ;
  SearchOptions.LookForSystemFile   := True ;
  SearchOptions.LookForDirectory    := True ;
  SearchOptions.LookForArchiveFile  := True ;
  SearchOptions.LookForAnyFile      := True ;

  { Initialize date filter }
  DateOptions.FilterOnDate     := False       ;
  DateOptions.FilterAccessKind := dfakAnyFiles;
  DateOptions.DateFilterKind   := dfkBefore   ;
  DateOptions.FirstDate        := Date        ;
  DateOptions.SecondDate       := Date        ;

  { Initialize size filter }
  SizeOptions.FilterOnSize   := False              ;
  SizeOptions.SizeFilterKind := sfkSmallerOrEqualTo;
  SizeOptions.Size           := 0                  ;

  { Initialize exclude filter }
  ExcludeFilters := TStringList.Create;

  { Filter & RootPath }
  FileNames := TStringList.Create;
  FileNames.Add('*.*');
  RootPath := '.\' ;

  { Events }
  OnFileFound  := nil;
  OnChangeFolder := nil;
  OnStatistics   := nil;
end;

{*****************************************************************************
 * Procedure : TFileSearch.Destroy
 * Purpose   : Destructor
 * Arguments : NONE
 * Result    : NONE
 *****************************************************************************
 * Alexandre GAMBIER (24/09/2002) : Creation
 *****************************************************************************}
destructor TFileSearch.Destroy;
begin
  { free exclude filter }
  FileNames.Free;
  ExcludeFilters.Free;
  
  inherited Destroy;
end;

{*****************************************************************************
 * Procedure : TFileSearch.GetAttributeFilter
 * Purpose   : Initialize the attribute filter
 * Arguments : NONE
 * Result    : Return the attribute filter
 *****************************************************************************
 * Alexandre GAMBIER (24/09/2002) : Creation
 *****************************************************************************}
function TFileSearch.GetAttributeFilter : Integer;
begin
  Result := 0;
  if SearchOptions.LookForReadOnlyFile=True then Result := Result or faReadOnly ;
  if SearchOptions.LookForHiddenFile  =True then Result := Result or faHidden   ;
  if SearchOptions.LookForSystemFile  =True then Result := Result or faSysFile  ;
  if SearchOptions.LookForDirectory   =True then Result := Result or faDirectory;
  if SearchOptions.LookForArchiveFile =True then Result := Result or faArchive  ;
end;

{*****************************************************************************
 * Procedure : TFileSearch.GetFileInformations
 * Purpose   : Convert file information into TFileInformations
 * Arguments : Path        > pathname of the file
 *             SearchInfos > informations given by FindFirst & FindNext
 * Result    : Return TFileInformation about the the file
 *****************************************************************************
 * Alexandre GAMBIER (24/09/2002) : Creation
 *****************************************************************************}
function TFileSearch.GetFileInformations(Path : String; SearchInfos : TSearchRec) : TFileInformations;
var
  TmpSysTime  : SYSTEMTIME;
  TmpFileTime : FILETIME;
begin
  Result.Name       := SearchInfos.Name;
  Result.Path       := Path            ;
  Result.Attributes := SearchInfos.Attr;
  Result.Size       := SearchInfos.Size;
  { Convert time access }
  FileTimeToLocalFileTime(SearchInfos.FindData.ftCreationTime, TmpFileTime);
  FileTimeToSystemTime(TmpFileTime, TmpSysTime);
  Result.Time.CreationTime := TmpSysTime;

  FileTimeToLocalFileTime(SearchInfos.FindData.ftLastAccessTime, TmpFileTime);
  FileTimeToSystemTime(TmpFileTime, TmpSysTime);
  Result.Time.AccessTime := TmpSysTime;

  FileTimeToLocalFileTime(SearchInfos.FindData.ftLastWriteTime, TmpFileTime);
  FileTimeToSystemTime(TmpFileTime, TmpSysTime);
  Result.Time.WriteTime := TmpSysTime;
end;

{*****************************************************************************
 * Procedure : TFileSearch.IsAttributesOk
 * Purpose   : Check if attributes are equals
 * Arguments : AttrToCheck   > Attribute 1
 * Result    : True if ok
 *****************************************************************************
 * Alexandre GAMBIER (24/09/2002) : Creation
 *****************************************************************************}
function TFileSearch.IsAttributesOk(AttrToCheck : Integer) : Boolean;
var
  AttrFilter : Integer;
begin
  Result := False;

  AttrFilter := GetAttributeFilter;

  if ((AttrToCheck and faReadOnly ) and (AttrFilter and faReadOnly ))<>0 then Result := True;
  if ((AttrToCheck and faHidden   ) and (AttrFilter and faHidden   ))<>0 then Result := True;
  if ((AttrToCheck and faSysFile  ) and (AttrFilter and faSysFile  ))<>0 then Result := True;
  if ((AttrToCheck and faDirectory) and (AttrFilter and faDirectory))<>0 then Result := True;
  if ((AttrToCheck and faArchive  ) and (AttrFilter and faArchive  ))<>0 then Result := True;
end;

{*****************************************************************************
 * Procedure : TFileSearch.IsDateOk
 * Purpose   : Check (if date filter is activate) if the file match with
 *             the filter
 * Arguments : FileInfos  > File Informations
 * Result    : Return True if the file match
 *****************************************************************************
 * Alexandre GAMBIER (26/09/2002) : Creation
 *****************************************************************************}
function TFileSearch.IsDateOk(FileInfos : TFileInformations) : Boolean;
var
  CreationTime : TDateTime;
  AccessTime   : TDateTime;
  WriteTime    : TDateTime;
  CreationOk   : Boolean  ;
  AccessOk     : Boolean  ;
  WriteOk      : Boolean  ;
  DateFilterOk : Boolean  ;
  FileInfosRef : TFileInformations;
  SysTime      : SYSTEMTIME;

begin

  { Check if filter on Date is activate }
  if DateOptions.FilterOnDate=False then DateFilterOk := True else
  begin
    { Initialize variable}
    DateFilterOk := False;
    CreationOk   := False;
    AccessOk     := False;
    WriteOk      := False;
    FileInfosRef := FileInfos;

    { Set time to 00:00:00 }
    { First Date}
    DateTimeToSystemTime(DateOptions.FirstDate, SysTime);
    SysTime.wHour         := 0;
    SysTime.wMinute       := 0;
    SysTime.wSecond       := 0;
    SysTime.wMilliseconds := 0;
    DateOptions.FirstDate := SystemTimeToDateTime(SysTime);
    { Second Date}
    DateTimeToSystemTime(DateOptions.SecondDate, SysTime);
    SysTime.wHour         := 0;
    SysTime.wMinute       := 0;
    SysTime.wSecond       := 0;
    SysTime.wMilliseconds := 0;
    DateOptions.SecondDate := SystemTimeToDateTime(SysTime);
    { Creation Date }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人一区二区| 欧美a一区二区| 蜜桃视频在线一区| 国产成人av电影在线| 欧美在线观看18| 国产精品色在线观看| 麻豆国产欧美一区二区三区| 91麻豆123| 亚洲va欧美va天堂v国产综合| 国产综合久久久久久鬼色| 欧美色视频一区| 国产精品不卡视频| 国产美女精品人人做人人爽| 欧美一区二区三区系列电影| 亚洲国产日日夜夜| 色婷婷一区二区三区四区| 欧美国产一区视频在线观看| 久久成人久久爱| 欧美一级欧美一级在线播放| 亚洲成人av中文| 欧美在线观看你懂的| 伊人夜夜躁av伊人久久| 99久久er热在这里只有精品15| 久久久久久久久伊人| 久久精品国产久精国产| 欧美一区二区视频在线观看| 同产精品九九九| 欧美日韩国产美| 亚洲国产美女搞黄色| 欧美亚洲一区二区三区四区| 一区二区久久久| 色综合网色综合| 亚洲精品久久7777| 91福利国产成人精品照片| 一级做a爱片久久| 色哟哟欧美精品| 亚洲最色的网站| 欧美日韩国产影片| 日韩不卡手机在线v区| 日韩一区二区三区观看| 蜜臀av一区二区| 国产午夜亚洲精品不卡| 波多野结衣的一区二区三区| 亚洲欧美日韩在线不卡| 欧美日韩国产高清一区| 奇米一区二区三区av| 7777女厕盗摄久久久| 久久99深爱久久99精品| 日韩一二在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 久久综合久色欧美综合狠狠| 国产美女视频91| 亚洲特黄一级片| 欧美日韩国产片| 久久国产精品99久久人人澡| 欧美极品aⅴ影院| 欧美婷婷六月丁香综合色| 美腿丝袜亚洲色图| 久久久.com| 91成人网在线| 欧美a级理论片| 国产精品久久久久三级| 国产精品一区二区x88av| 久久香蕉国产线看观看99| 99麻豆久久久国产精品免费优播| 成人免费在线播放视频| 久久久久久久久久久久久女国产乱 | 欧美巨大另类极品videosbest| 久久精品久久久精品美女| 成人欧美一区二区三区在线播放| 欧美日本国产视频| 成人午夜视频在线| 日本中文在线一区| 亚洲欧洲精品一区二区三区不卡| 91精品国产色综合久久不卡蜜臀 | 国产色产综合产在线视频| 色综合天天综合狠狠| 精品在线亚洲视频| 亚洲一区二区视频| 中文字幕不卡一区| 精品欧美一区二区三区精品久久| 91性感美女视频| 久久99精品视频| 亚洲一区二区三区美女| 国产日韩在线不卡| 欧美一级生活片| 91国产免费观看| 国产成人99久久亚洲综合精品| 亚洲一区二区美女| **网站欧美大片在线观看| 精品盗摄一区二区三区| 欧美日韩午夜在线| 一本色道亚洲精品aⅴ| 国产69精品久久777的优势| 久久国产生活片100| 偷拍一区二区三区四区| 亚洲午夜久久久久久久久电影网 | 精品久久久久久久人人人人传媒| 欧美天天综合网| 色诱视频网站一区| va亚洲va日韩不卡在线观看| 国产xxx精品视频大全| 国产一区二区三区黄视频 | 亚洲风情在线资源站| 中文字幕一区二区三区在线播放| www国产成人| 精品国产不卡一区二区三区| 宅男在线国产精品| 欧美日韩视频第一区| 在线免费观看成人短视频| 99久久亚洲一区二区三区青草| 福利电影一区二区| 成人免费毛片嘿嘿连载视频| 国产91色综合久久免费分享| 国产成人午夜高潮毛片| 国产成人精品免费| proumb性欧美在线观看| 91色在线porny| 日本韩国欧美国产| 欧美老人xxxx18| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 在线视频国产一区| 欧美久久久一区| 日韩一区二区精品| 久久久影视传媒| 成人免费在线视频| 亚洲亚洲精品在线观看| 日韩精品国产欧美| 国产精品一级在线| 波多野结衣中文一区| 一本色道久久综合精品竹菊| 欧美视频在线一区二区三区 | 亚洲一卡二卡三卡四卡五卡| 亚洲国产综合91精品麻豆| 青青草原综合久久大伊人精品| 日韩国产欧美三级| 国产在线播放一区| 99久久免费国产| 91精品在线免费| 国产夜色精品一区二区av| 亚洲人成网站影音先锋播放| 一区二区久久久久| 激情综合色综合久久综合| 99久久精品国产麻豆演员表| 欧美日韩免费一区二区三区 | 在线播放/欧美激情| 欧美精品一区二区在线观看| 国产精品美女久久久久久久久久久 | 日韩午夜精品视频| 久久久久青草大香线综合精品| 亚洲欧美日韩一区二区三区在线观看| 日韩和欧美的一区| 白白色 亚洲乱淫| 欧美一区二区在线看| 国产精品私人自拍| 日韩成人一级片| 91亚洲国产成人精品一区二区三| 日韩一区二区精品葵司在线| 亚洲免费看黄网站| 国产精品自拍网站| 欧美日韩一区久久| 亚洲国产高清aⅴ视频| 亚洲一区在线观看视频| 国产精品香蕉一区二区三区| 欧美写真视频网站| 中文天堂在线一区| 麻豆精品国产91久久久久久| 色综合久久综合网97色综合| 国产性色一区二区| 久久国产精品免费| 欧美精品久久久久久久多人混战| 国产午夜精品美女毛片视频| 日韩1区2区日韩1区2区| 色天使色偷偷av一区二区| 国产欧美一二三区| 蜜臀精品久久久久久蜜臀| 欧美亚洲一区三区| 亚洲欧美日本在线| 成人动漫中文字幕| 久久久久久久网| 激情综合网激情| 日韩欧美亚洲一区二区| 天天综合网天天综合色| 在线看国产日韩| 亚洲欧美日韩中文字幕一区二区三区| 国产精一品亚洲二区在线视频| 日韩免费观看高清完整版在线观看| 亚洲3atv精品一区二区三区| 色天天综合久久久久综合片| 国产精品白丝在线| av成人老司机| 17c精品麻豆一区二区免费| 成人av综合一区| 国产精品久久久爽爽爽麻豆色哟哟| 国产在线播放一区三区四| 亚洲免费视频中文字幕| 99久久伊人网影院| 综合久久综合久久| 97精品国产97久久久久久久久久久久| 国产女人18水真多18精品一级做|