- 2
- 0
- 约1.07万字
- 约 9页
- 2018-01-04 发布于河南
- 举报
delphi中 有用的函数
uses FileCtrl; private { Private declarations } FFileName: string; //得到路径。 function GetPath: string; //获得目录名称。 function GetDirectoryName(Dir: string): string; procedure FindFiles(aPath: string); //磁盘检查 function CheckDisk(Drive: Byte; aSize: Int64): Boolean; //检查目录的大小 function CheckFileSize(aPath: string): Int64; //检查备份文件是否存在,不存在或存在按 确定 返回“真” function CheckFileExists(aFileNameString: string): Boolean; public { Public declarations } end;var FormBackUp: TFormBackUp; IsClickStop: Boolean = False;//按‘取消’按钮时返回‘真’。 DirectorySize: Int64;//文件夹大小。implementation{$R *.DFM}const a1 = 系统已经完成对记录“ ; a2 = ”的备份。是否将记录“ ; a3 = ”删除? ;function TFormBackUp.GetPath: string;begin if RbAlias.Checked then begin if cbAlias.Text = then raise Exception.Create( 请选择别名。 ); Result := D:\aaa\ + CbAlias.Text; end else if RbFlolder.Checked then Result := edPath.Text else Result := ; if Result = then raise Exception.Create( 您没有选择路径! ); if not DirectoryExists(Result) then raise Exception.CreateFmt( 文件夹 “%s”不存在。 , [Result]);end;function TFormBackUp.CheckFileSize(aPath: string): Int64;begin DirectorySize := 0; try Screen.Cursor := crHourGlass; FFileName := *.* ; FindFiles(aPath); Result := DirectorySize; Result := Result div 5; finally Screen.Cursor := crDefault; end;end;function TFormBackUp.GetDirectoryName(Dir: string): string;begin if Dir[Length(Dir)] \ then Result := Dir + \ else Result := Dir;end;procedure TFormBackUp.FindFiles(aPath: string);var FSe
您可能关注的文档
最近下载
- 数字图像处理图像编码.ppt VIP
- 湖北城市建设职业职业技术学院2025年高职单招考试城市燃气工程技术专业考试大纲.pdf VIP
- 长帝电烤箱TV42W使用说明书用户手册.pdf
- 气象学与气候学课件.pptx
- 电子科技大学《光电图像处理》 第六章 图像编码与压缩 ppt课件.pptx VIP
- 对外经济贸易大学2021-2022学年《Python程序设计》期末考试试卷(A卷)及标准答案.docx
- 高考数学极值点偏移练习题(含答案).docx VIP
- 化工过程安全管理导则-装置安全规划与设计课件.pptx VIP
- 五脏与情志 jt叔叔 JT叔叔伤寒杂病论慢慢教(.)五脏与情志.doc VIP
- 图像处理与分析图像的编码技术.ppt VIP
原创力文档

文档评论(0)