⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 untloadfav.pas

📁 驱动备份顾名思义就是备份操作系统的各个硬件的驱动程序
💻 PAS
字号:
//  untLoadFav单元
//  作用:载入URL文件
//  版本:1.0.0.0
//  作者:林仕君
//  日期:2004.9.20

unit untLoadFav;

interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ComCtrls;

procedure LoadFile(Path:string;StrLst:TStringList);
procedure LoadPath(Path:string;StrLst:TStringList);

implementation

//搜索出收藏夹中的所有URL文件
procedure LoadFile(Path:string;StrLst:TStringList);
  var
      DirInfo:TSearchRec;
      r:Integer;
begin
    if path[length(path)]<>'\' then path:=path+'\';
    r:=FindFirst(Path+ '*.*',FaAnyfile, DirInfo);//开始搜索
    while r=0 do
      begin
          application.ProcessMessages;
          if ((DirInfo.Attr and FaDirectory <> FaDirectory) and
               (DirInfo.Attr and FaVolumeId <> FaVolumeID)) then
            if Lowercase(ExtractFileExt(DirInfo.Name))='.url' then
              StrLst.Add(Path+DirInfo.Name);//将搜索到的URL文件放入列表
          if(DirInfo.Name <> '.')and(DirInfo.Name <> '..') then //判断是否是文件夹
            //若是文件夹则递归本身,进行下个目录的搜索
            LoadFile(Path+DirInfo.Name,StrLst);
          r := FindNext(DirInfo);//搜索下一个文件
      end;
    FindClose(DirInfo);//关闭
end;

//获取一个目录下的所有子目录路径(各个文件夹路径)
procedure LoadPath(Path:string;StrLst:TStringList);
  var
      DirInfo:TSearchRec;
      r:Integer;
begin
    if path[length(path)]<>'\' then path:=path+'\';
    r:=FindFirst(Path+ '*.*',FaAnyfile, DirInfo);
    while r=0 do
      begin
          application.ProcessMessages;
              if(DirInfo.Attr and faDirectory>0 ) and (DirInfo.Name <> '.')and
                  (DirInfo.Name <> '..') then
                        StrLst.Add(Path+DirInfo.Name);
          r:=FindNext(DirInfo);
      end;
    FindClose(DirInfo);
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -