<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

    搜索

    •  

    積分與排名

    • 積分 - 825755
    • 排名 - 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
    主站蜘蛛池模板: 亚洲欧洲中文日韩久久AV乱码| 全免费一级毛片在线播放| 亚洲人成无码www久久久| 国产午夜亚洲精品不卡| 成年女人毛片免费观看97| 91亚洲国产成人久久精品| 99re这里有免费视频精品 | 久9久9精品免费观看| 国产国拍亚洲精品mv在线观看 | 五级黄18以上免费看| 国产一级淫片a视频免费观看| 国产亚洲人成在线播放| 国产一区二区三区在线免费| 免费大片黄在线观看| 亚洲国产精品成人一区| 国产免费AV片在线观看播放| 区三区激情福利综合中文字幕在线一区亚洲视频1 | 亚洲成av人片天堂网老年人| ssswww日本免费网站片| 亚洲av永久无码精品秋霞电影影院| 免费女人高潮流视频在线观看| 亚洲国产av一区二区三区丶| 精品国产免费一区二区| 极品美女一级毛片免费| 亚洲中文字幕无码爆乳AV| 99re6在线精品视频免费播放| 亚洲日本久久一区二区va| 日本免费人成黄页在线观看视频| 国产成人亚洲精品91专区高清 | 无码国产精品久久一区免费| 国产精品亚洲专区无码牛牛| 亚洲一本大道无码av天堂| 久久久免费的精品| 亚洲av无码专区在线电影天堂 | 免费精品一区二区三区第35| 亚洲一区无码中文字幕乱码| 免费萌白酱国产一区二区| 久久青草91免费观看| 亚洲愉拍一区二区三区| 亚洲综合AV在线在线播放| 台湾一级毛片永久免费|