RT
解决方案 »
- LISTVIEW单行变色问题
- 请各位大大看一下
- 泡泡堂外挂制作的问题?
- 关于制作启动画面中碰到的问题!
- 如何在DELPHI5中调用MICROSOFT ACCESSXP数据库文件?
- 关于stringgrid 中日期型数据的问题
- 谁有Delphi 7的update1(2003.1.16)?
- ^>_<^欢迎你:怎么用ADO技术来写SQL的存储过程啊!
- 大家只要告诉我,我的问题是不是太难,就给分阿
- 如何向lookup字段的在dbgrid的下拉表中添加内容?????????????????
- 我想做一个登陆界面,界面中需要输入用户名和密码,用户名、密码........
- 怎么判断系统安装在那个目录下(比如:c:\windows或是d:\winnt),谢谢
if FindFirst(const Path: string; Attr: Integer; var F:
TSearchRec)
begin
repeat
...... until findnext(F)<>0
end;
if (FindFirst(mainpath+'*.*', faDirectory, SearchRec)=0) thenbeginsubdir1.Add(SearchRec.Name);while (FindNext(SearchRec) = 0) dobeginstringList.Add(SearchRec.Name);end;end;
if (FindFirst(mainpath+'*.*', faDirectory, SearchRec)=0) thenbegin
while (FindNext(SearchRec) = 0) dobeginstringList.Add(SearchRec.Name);end;
function mform.###(curdir:string):integer;
var
sr:tsearchrec;
FileAttrs: Integer;
filecount: integer;
begin
filecount:=0; FileAttrs := 0;
//以下是增加搜索文件的属性,以搜索更多的文件,
FileAttrs := FileAttrs + faHidden;
FileAttrs := FileAttrs + faSysFile;
FileAttrs := FileAttrs + faVolumeID;
FileAttrs := FileAttrs + faDirectory;
FileAttrs := FileAttrs + faArchive;
FileAttrs := FileAttrs + faAnyFile; if DirectoryExists(curdir)=true then
begin
if FindFirst(curdir+'\*.*', fileattrs, sr) = 0 then
repeat
begin
//此处添加对索索文件的操作
end
until FindNext(sr) <> 0;
FindClose(sr); {$I-}
rmdir(curdir);
if ioresult<>0 then
result:=-2
else
result:=filecount;
end
else
begin
result:=-1;
end;end;!!!
特别注意,在删除搜索的子目录时,应该注意两个特别的目录“.”和“..”
以免将当前目录和上一级目录误删除或造成死锁等错误。
THANK YOU!