<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

    搜索

    •  

    積分與排名

    • 積分 - 829249
    • 排名 - 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
    主站蜘蛛池模板: 成人亚洲国产精品久久| 亚洲人成网站18禁止| 中文字幕成人免费高清在线| 国产精品国产自线拍免费软件| 亚洲熟妇久久精品| 真实乱视频国产免费观看 | 亚洲大片免费观看| 中文字幕亚洲综合精品一区| 99精品国产成人a∨免费看| 亚洲一区二区三区高清| 18级成人毛片免费观看| 亚洲国产情侣一区二区三区| 无人影院手机版在线观看免费| 亚洲精品综合在线影院| 午夜精品在线免费观看| 久久久久亚洲国产AV麻豆| 亚洲AV永久无码精品一区二区国产| 阿v免费在线观看| 亚洲人成色777777在线观看| 日本免费人成视频在线观看| 久久亚洲AV无码精品色午夜麻豆| 最新黄色免费网站| 亚洲中文精品久久久久久不卡| 国产成人3p视频免费观看| 黄色视频在线免费观看| 亚洲国产精品一区二区久久| 国产麻豆视频免费观看| 麻豆69堂免费视频| 亚洲成人动漫在线| 在线中文高清资源免费观看| 香蕉国产在线观看免费| 亚洲天堂男人天堂| 四虎影视大全免费入口| fc2成年免费共享视频18| 亚洲午夜精品一区二区| 午夜一级免费视频| 永久在线观看免费视频| 亚洲精品无码你懂的| 亚洲中文字幕不卡无码| 免费在线观看的网站| 9i9精品国产免费久久|