<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 6  文章 - 129  trackbacks - 0
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(14)

    隨筆檔案(6)

    文章分類(467)

    文章檔案(423)

    相冊

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 825498
    • 排名 - 49

    最新評論

    閱讀排行榜

    評論排行榜

    copy:http://www.jackfeng.com/archives/276/

    {-------------------------------------------------------------------------------
    過程名:    MakeFileList 遍歷文件夾及子文件夾
    作者:      SWGWEB
    日期:      2007.11.25
    參數:      Path,FileExt:string   1.需要遍歷的目錄 2.要遍歷的文件擴展名
    返回值:    TStringList

       Eg:ListBox1.Items:= MakeFileList( 'E:\極品飛車','.exe') ;
           ListBox1.Items:= MakeFileList( 'E:\極品飛車','.*') ;
    -------------------------------------------------------------------------------}
    function MakeFileList(Path,FileExt:string):TStringList ;
    var
    sch:TSearchrec;
    begin
    Result:=TStringlist.Create;

    if rightStr(trim(Path), 1) <> '\' then
        Path := trim(Path) + '\'
    else
        Path := trim(Path);

    if not DirectoryExists(Path) then
    begin
        Result.Clear;
        exit;
    end;

    if FindFirst(Path + '*', faAnyfile, sch) = 0 then
    begin
        repeat
           Application.ProcessMessages;
           if ((sch.Name = '.') or (sch.Name = '..')) then Continue;
           if DirectoryExists(Path+sch.Name) then
           begin
             Result.AddStrings(MakeFileList(Path+sch.Name,FileExt));
           end
           else
           begin
             if (UpperCase(extractfileext(Path+sch.Name)) = UpperCase(FileExt)) or (FileExt='.*') then
             Result.Add(Path+sch.Name);
           end;
        until FindNext(sch) <> 0;
        SysUtils.FindClose(sch);
    end;
    end;

    ------------------------------------------------------------------------------------------------------------------------------------

    字符截取函數LeftStr, MidStr, RightStr
    這幾個函數都包含在StrUtils中,所以需要uses StrUtils;
    假設字符串是 Dstr := ’Delphi is the BEST’, 那么
    LeftStr(Dstr, 5) := ’Delph’
    MidStr(Dstr, 6, 7) := ’i is th’
    RightStr(Dstr, 6) := ’e BEST’

    ~~~~~~~~~~~~~~~~~~~~~~~~~
    function RightStr
        (Const Str: String; Size: Word): String;
    begin
      if Size > Length(Str) then Size := Length(Str) ;
      RightStr := Copy(Str, Length(Str)-Size+1, Size)
    end;
    function MidStr
        (Const Str: String; From, Size: Word): String;
    begin
      MidStr := Copy(Str, From, Size)
    end;
    function LeftStr
        (Const Str: String; Size: Word): String;
    begin
      LeftStr := Copy(Str, 1, Size)
    end;

    這幾個函數經常結合Pos, Length, Copy使用




    posted on 2010-05-19 11:48 Ke 閱讀(3548) 評論(0)  編輯  收藏 所屬分類: delphi
    主站蜘蛛池模板: 亚洲网红精品大秀在线观看| 免费国产a国产片高清网站| 国产成人精品日本亚洲专区61| 亚洲6080yy久久无码产自国产| 最新中文字幕免费视频| 亚洲日韩精品无码专区加勒比☆| 成年午夜视频免费观看视频| 亚洲日韩国产AV无码无码精品| 全免费A级毛片免费看网站| 亚洲日本天堂在线| 成人黄页网站免费观看大全| 中文字幕亚洲综合久久综合| 暖暖免费高清日本中文| 国产精品久久亚洲一区二区| 亚洲AV无码一区二三区| 两个人日本WWW免费版 | 免费一级特黄特色大片在线| 免费大片av手机看片高清| 中文字幕亚洲一区二区三区| 三年片在线观看免费| 亚洲天堂电影在线观看| 成人免费777777| 一级毛片a免费播放王色电影 | 国产91色综合久久免费| 色天使亚洲综合在线观看| 免费国产人做人视频在线观看| 一级中文字幕乱码免费| 亚洲av无码一区二区三区不卡| 51视频精品全部免费最新| 亚洲熟女综合色一区二区三区 | 曰批视频免费40分钟试看天天| tom影院亚洲国产一区二区| 国产又黄又爽又刺激的免费网址| 国产免费久久精品丫丫| 亚洲福利电影一区二区?| 国产视频精品免费| 黄色免费在线网站| 亚洲人成人无码.www石榴| 伊伊人成亚洲综合人网7777| 久视频精品免费观看99| 无忧传媒视频免费观看入口|