<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年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(14)

    隨筆檔案(6)

    文章分類(467)

    文章檔案(423)

    相冊

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 829293
    • 排名 - 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 閱讀(3562) 評論(0)  編輯  收藏 所屬分類: delphi
    主站蜘蛛池模板: 亚洲狠狠婷婷综合久久久久| 国产AV无码专区亚洲AVJULIA| 一级中文字幕免费乱码专区| 亚洲av午夜成人片精品网站| 久草视频免费在线| 国产精品亚洲一区二区无码| 国产成人亚洲精品青草天美| 免费H网站在线观看的| 一级视频免费观看| 亚洲综合色丁香麻豆| 国产色婷婷精品免费视频| 毛片在线全部免费观看| 亚洲色欲啪啪久久WWW综合网| 亚洲香蕉成人AV网站在线观看| 性xxxxx免费视频播放| 一级毛片a女人刺激视频免费| 亚洲精品白色在线发布| 亚洲av日韩av欧v在线天堂| 99在线观看精品免费99| 高h视频在线免费观看| 亚洲图片激情小说| 亚洲人成网77777色在线播放| 毛片免费在线观看网站| 水蜜桃视频在线观看免费播放高清| 国产亚洲中文日本不卡二区| 国产亚洲精品va在线| 国产高清在线免费| 在线免费观看国产| 一级特黄录像免费播放中文版| 久久亚洲精品专区蓝色区| 亚洲国产精彩中文乱码AV| 免费看一级做a爰片久久| 日本免费xxxx色视频| 99精品全国免费观看视频..| 粉色视频成年免费人15次| 亚洲国产韩国一区二区| 亚洲国产精品VA在线看黑人| 久久久久国产亚洲AV麻豆| 日本免费人成视频播放| 国拍在线精品视频免费观看 | 最新中文字幕电影免费观看|