procedure ZsDelPath(mDirName: string); { 删除指定路径 }
var
Sr: TSearchRec;
PathName: string;
K: Integer;
begin
PathName := mDirName + '\*.*';
K := FindFirst(PathName, faAnyFile, Sr);
while K = 0 do begin
if (Sr.Attr in [faDirectory]) and (Pos(Sr.Name, '..') = 0) then begin
Sr.Attr := 16;
// ~~~~~~~~~~~~
ZsDelPath(mDirName + '\' + Sr.Name);
end else if Pos(Sr.Name, '..') = 0 then begin
Sr.Attr := 0;
// ~~~~~~~~~~~~
DeleteFile(PChar(mDirName + '\' + Sr.Name));
end;
K := FindNext(Sr);
end;
RmDir(mDirName);
end; { ZsDelPath }
var
Sr: TSearchRec;
PathName: string;
K: Integer;
begin
PathName := mDirName + '\*.*';
K := FindFirst(PathName, faAnyFile, Sr);
while K = 0 do begin
if (Sr.Attr in [faDirectory]) and (Pos(Sr.Name, '..') = 0) then begin
Sr.Attr := 16;
// ~~~~~~~~~~~~
ZsDelPath(mDirName + '\' + Sr.Name);
end else if Pos(Sr.Name, '..') = 0 then begin
Sr.Attr := 0;
// ~~~~~~~~~~~~
DeleteFile(PChar(mDirName + '\' + Sr.Name));
end;
K := FindNext(Sr);
end;
RmDir(mDirName);
end; { ZsDelPath }
解决方案 »
- DevExpress_v.28 安装后 cxgrid编译错误
- if 语句的用法
- 在DBGridEh中左右拖动分割条以增大或缩小字段显示宽度时,经常弹出如下提示,
- DLL 调用问题? 高手请进! UP 有分呀。。。。
- 如何实现 UPDATE fhbiao set biaohao=biaohao+'2' 的操作?
- 我用DelphiX For D7开发RPG游戏
- 高手切磋技艺:我看到一个程序,可以在运行期间调出Delphi的Object Inspect来修改控件的属性,有没谁会做这样的程序?
- Delphi编程如何取得目录下的所有子目录和文件的列表(不用控件)请赐教
- 请问哪里有较好的AuthorWare的论坛。
- 标签打印机打印图片的问题(有vb代码,如何转为delphi)
- ado?
- 关于文件流的问题
faHidden = $00000002 platform;
faSysFile = $00000004 platform;
faVolumeID = $00000008 platform;
faDirectory = $00000010;
faArchive = $00000020 platform;
faAnyFile = $0000003F;
attrib +r +s +h 文件名 添加属性
attrib -r -s +h 文件名 去掉属性
r 代表只读
s 代表系统
h 代表隐藏
看清楚了!!
我问的是相关的DOS命令!!
vcl那套我会!