var sr: TSearchRec ;
    Dir: String ;
    XMLFiles: TStringList ;
begin
     Dir := ExtractFilePath(ParamStr(0)) ;
     //选择路径,如果没有选择,直接退出
     if not SelectDirectory(''r, EmptyStr, Dir) then Exit ;     if FindFirst(Dir + '\' + '*.txt, $0000003F, sr) = 0 then
        begin
        XMLFiles := TStringList.Create ;
        repeat
           XMLFiles.Add(sr.Name) ;
           until FindNext(sr) <> 0; //end of repeat
        FindClose(sr) ;
        end //of if