2011年9月6日

文件磁盘相关函数-搜索文件 FindFirst; FindNext; FindClose

摘要: 代码如下:implementation{$R *.dfm}var estr:string;procedure TForm1.N10Click(Sender: TObject);//搜索文件 FindFirst; FindNext; FindClosevar sr: TSearchRec; //定义 TSearchRec 结构变量 Attr: Integer; //文件属性begin estr := Edit1.Text; Attr := faAnyFile; //文件属性值faAnyFile表示是所有文件 if FindFirst(est... 阅读全文

posted @ 2011-09-06 19:24 delphi初学者 阅读(1098) 评论(0) 推荐(0) 编辑

查找指定文件

摘要: 查找文件function FileSearch(const Name, //要查找文件的文件名 DirList: string //指定在哪个目录查找 ): string; //如果函数成功,返回一个包含路径文件名的字符串,否则返回空串procedure TForm1.N9Click(Sender: TObject);//查找指定文件 FileSearchvar FileName,Dir,s: string;begin FileName := 'notepad.exe'; // 要找的文件 Dir := '... 阅读全文

posted @ 2011-09-06 19:20 delphi初学者 阅读(577) 评论(0) 推荐(0) 编辑

导航