摘要: 使用函数: System.IOUtils.TDirectory.IsRelativePathclass function IsRelativePath(const Path: string): Boolean; inline; static;异常处理:无,纯粹判断路径,与目录是否存在无关代码:begin // 判断指定目录是否为相对路径 try if (TDirectory.IsRelativePath(Trim(Edit1.Text))) then ShowMessage(Edit1.Text + '是相对路径') else ... 阅读全文
posted @ 2014-01-02 14:53 oszhouzhb 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 使用函数: System.IOUtils.TDirectory.IsEmptyclass function IsEmpty(const Path: string): Boolean; static;说明:参数为给定目录,返回布尔值异常处理:指定目录为空或无效代码:var sDir: string;procedure TForm1.Button1Click(Sender: TObject);begin if not SelectDirectory('', 'H:\', sDir) then Exit;end;procedure TForm1.Button_Chec 阅读全文
posted @ 2014-01-02 14:44 oszhouzhb 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 使用函数: System.IOUtils.TDirectory.GetParentclass function GetParent(const Path: string): string; static;说明:返回给定目录的父目录,相对路径则为当前工作路径异常处理:指定目录不存在或无效代码:procedure TForm1.Button1Click(Sender: TObject);begin try //获取指定目录的父目录 //异常:指定目录不存在或无效 ShowMessage(Edit1.Text + '的父目录为:' + TDirect... 阅读全文
posted @ 2014-01-02 14:27 oszhouzhb 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 使用函数: System.IOUtils.TDirectory.GetLogicalDrivesclass function GetLogicalDrives: TStringDynArray; static;说明:返回一个动态数组驱动器列表如:C:\ D:\....代码:procedure TForm1.Button_GetDriClick(Sender: TObject);var dyArr: TStringDynArray; //System.Types.TStringDynArray sDri: string;begin dyArr := TDirectory.Ge... 阅读全文
posted @ 2014-01-02 14:18 oszhouzhb 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 使用函数: System.IOUtils.TDirectory.GetCreationTime System.IOUtils.TDirectory.GetLastAccessTime System.IOUtils.TDirectory.GetLastWriteTime System.IOUtils.TDirectory.SetCreationTime System.IOUtils.TDirectory.SetLastAccessTime System.IOUtils.TDirectory.SetLastWriteTime代码: unit Unit1;interfaceuses ... 阅读全文
posted @ 2014-01-02 14:11 oszhouzhb 阅读(232) 评论(0) 推荐(0) 编辑