当前位置: 首页 > news >正文

江苏太仓建设局网站flash全站案例网站预览

江苏太仓建设局网站,flash全站案例网站预览,自由贸易区的建设网站,百度一下首页百度一下System.SysUtils.AnsiCompareFileName 根据当前语言环境比较文件名。 在 Windows 下不区分大小写#xff0c;在 MAC OS 下区分大小写。 在不使用多字节字符集 (MBCS) 的 Windows 区域设置下#xff0c;AnsiCompareFileName 与 AnsiCompareText 相同。在 MAC OS 和 Linux 下在 MAC OS 下区分大小写。 在不使用多字节字符集 (MBCS) 的 Windows 区域设置下AnsiCompareFileName 与 AnsiCompareText 相同。在 MAC OS 和 Linux 下AnsiCompareFileName 与 AnsiCompareStr 相同。 beginif SameFileName(D:\ceshi\新建文件夹\ceshi.txt, D:\ceshi\新建文件夹\ceshi.txt) thenMemo1.Lines.Add(文件名相同);//输出 文件名相同 if AnsiCompareFileName(ceshi.txt, CESHI.txt) 0 thenMemo1.Lines.Add(相等Windows下不区分大小写)elseMemo1.Lines.Add(不相等);//输出 相等Windows下不区分大小写 end;System.SysUtils.AnsiLowerCaseFileName 将文件名转换为小写。 beginMemo1.Lines.Add(AnsiLowerCaseFileName(CESHI.txt));//输出 ceshi.txt end;System.IOUtils.TPath.ChangeExtension class function ChangeExtension(const Path, Extension: string): string;更改给定路径指示的文件或目录的扩展名。 beginMemo1.Lines.Add(TPath.ChangeExtension(C:\Users\Administrator\Desktop\ceshi.txt, xml));//输出 C:\Users\Administrator\Desktop\ceshi.xml end;System.SysUtils.ChangeFileExt function ChangeFileExt(const FileName, Extension: string): string;更改文件名的扩展名。 beginMemo1.Lines.Add(ChangeFileExt(ceshi.txt, .xml));//输出 ceshi.xml end;System.SysUtils.ChangeFilePath 更改文件名的路径。 beginMemo1.Lines.Add(ChangeFilePath(C:\Users\Administrator\Desktop\ceshi.txt, D:\));//输出 D:\ceshi.txt end;System.SysUtils.DirectoryExists 判断指定目录是否存在。 beginif DirectoryExists(D:\ceshi) thenMemo1.Lines.Add(文件目录存在)elseMemo1.Lines.Add(文件目录不存在); end;System.IOUtils.TPath.Combine 组合两个路径字符串。 beginMemo1.Lines.Add(TPath.Combine(D:\ceshi\新建文件夹, 新建文件夹 (2)));//输出 D:\ceshi\新建文件夹\新建文件夹 (2) end;System.IOUtils.TPath.DriveExists 检查给定路径中使用的驱动器号是否实际存在。 varvPath: string; beginvPath : D:\ceshi2;if TPath.DriveExists(vPath) thenbeginMemo1.Lines.Add(驱动器号存在);if not DirectoryExists(vPath) thenMemo1.Lines.Add(文件目录不存在);end; end;System.SysUtils.ExcludeTrailingBackslash 返回不带尾部分隔符的路径名。 beginMemo1.Lines.Add(ExcludeTrailingBackslash(D:\ceshi\新建文件夹\));//输出 D:\ceshi\新建文件夹 end;System.SysUtils.ExcludeTrailingPathDelimiter 返回不带尾部分隔符的路径名。 与 ExcludeTrailingBackslash 相同。 System.SysUtils.ExpandFileName 返回相对文件名的完整路径名。 begin//相对于程序运行路径的完整路径Memo1.Lines.Add(ExpandFileName(新建文件夹\ceshi));//输出 D:\Project1\Win32\Debug\新建文件夹\ceshi end;System.SysUtils.ExpandFileNameCase 返回区分大小写的文件系统上相对文件名的完整路径名。 在 Windows 下与 ExpandFileName 相同。在 MAC OS 和 Linux 下查找文件 uses System.TypInfo;varvMatch: TFilenameCaseMatch; beginMemo1.Lines.Add(ExpandFileNameCase(ceshi.txt, vMatch));//输出 C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Win32\Debug\ceshi.txtMemo1.Lines.Add(GetEnumName(TypeInfo(TFilenameCaseMatch), Ord(vMatch)));//输出 mkNone end;System.SysUtils.ExpandUNCFileName 如果合适以 UNC 格式返回文件名的完整路径。 begin//在“网络位置”中Memo1.Lines.Add(ExpandUNCFileName(ceshi.txt));//输出 \\192.168.1.1\ceshi\ceshi.txt end;System.SysUtils.ExtractFileDir 从文件名中提取驱动器和目录部分。 beginMemo1.Lines.Add(ExtractFileDir(D:\ceshi\新建文件夹\ceshi.txt));//输出 D:\ceshi\新建文件夹 end;System.SysUtils.ExtractFileDrive 返回文件名的驱动器部分。 beginMemo1.Lines.Add(ExtractFileDrive(D:\ceshi\新建文件夹\ceshi.txt));//输出 D: end;System.SysUtils.ExtractFileExt 返回文件名的扩展名部分。 beginMemo1.Lines.Add(ExtractFileExt(ceshi.txt));//输出 .txtMemo1.Lines.Add(ExtractFileExt(D:\ceshi\新建文件夹\ceshi.txt));//输出 .txt end;System.SysUtils.ExtractFileName 提取文件名的名称和扩展名部分。 beginMemo1.Lines.Add(ExtractFileName(ceshi.txt));//输出 ceshi.txtMemo1.Lines.Add(ExtractFileName(D:\ceshi\新建文件夹\ceshi.txt));//输出 ceshi.txt end;System.SysUtils.ExtractFilePath 返回文件名的驱动器和目录部分。 beginMemo1.Lines.Add(ExtractFilePath(ceshi.txt));//输出 Memo1.Lines.Add(ExtractFilePath(D:\ceshi\新建文件夹\ceshi.txt));//输出 D:\ceshi\新建文件夹\ end;System.SysUtils.ExtractRelativePath 返回相对于特定基目录的相对路径名。 begin//路径需要带“\”否则返回错误ExtractRelativePath(D:\ceshi\新建文件夹\, D:\ceshi\新建文件夹 (2)\);//输出 ..\新建文件夹 (2)\ end;System.SysUtils.ExtractShortPathName 将文件名转换为简短的8.3格式。 begin//文件必须存在才返回Memo1.Lines.Add(ExtractShortPathName(C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\bds.exe));//输出 C:\PROGRA~2\EMBARC~1\Studio\22.0\bin\bds.exe end;System.IOUtils.TPath.GetAttributes class function GetAttributes(const Path: string; FollowLink: Boolean True): TFileAttributes;返回文件或目录属性。 uses System.IOUtils, System.TypInfo;varvAttributes: TFileAttributes;vAttrib: TFileAttribute; beginvAttributes : TPath.GetAttributes(D:\ceshi\新建文件夹\);for vAttrib in vAttributes doMemo1.Lines.Add(GetEnumName(TypeInfo(TFileAttribute), Ord(vAttrib)));//输出 faDirectoryvAttributes : TPath.GetAttributes(D:\ceshi\新建文件夹\ceshi.txt);for vAttrib in vAttributes doMemo1.Lines.Add(GetEnumName(TypeInfo(TFileAttribute), Ord(vAttrib)));//输出 GetAttributes end;System.IOUtils.TPath.GetDirectoryName 提取文件名的驱动器和目录部分。 beginMemo1.Lines.Add( TPath.GetDirectoryName(D:\ceshi\新建文件夹\ceshi.txt));//输出 D:\ceshi\新建文件夹 end;System.IOUtils.TPath.GetExtendedPrefix 返回给定路径的扩展前缀类型。 beginTPath.GetExtendedPrefix(D:\ceshi\新建文件夹\);//输出 pptNoPrefix end;System.IOUtils.TPath.GetExtension 提取文件名的扩展名部分。 beginMemo1.Lines.Add(TPath.GetExtension(ceshi.txt));//输出 .txtMemo1.Lines.Add(TPath.GetExtension(D:\ceshi\新建文件夹\ceshi.txt));//输出 .txt end;System.IOUtils.TPath.GetFileName 提取文件名的名称和扩展名部分。 beginMemo1.Lines.Add(TPath.GetFileName(ceshi.txt));//输出 ceshi.txtMemo1.Lines.Add(TPath.GetFileName(D:\ceshi\新建文件夹\ceshi.txt));//输出 ceshi.txt end;System.IOUtils.TPath.GetFileNameWithoutExtension 提取文件名的名称部分不带扩展名。 beginMemo1.Lines.Add(TPath.GetFileNameWithoutExtension(ceshi.txt));//输出 ceshiMemo1.Lines.Add(TPath.GetFileNameWithoutExtension(D:\ceshi\新建文件夹\ceshi.txt));//输出 ceshi end;System.IOUtils.TPath.GetFullPath 返回给定路径的绝对路径。 beginMemo1.Lines.Add(TPath.GetFullPath(ceshi.txt));//输出 C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Win32\Debug\ceshi.txt end;System.IOUtils.TPath.GetGUIDFileName 生成可用作唯一文件名的新 GUID。 beginMemo1.Lines.Add(TPath.GetGUIDFileName);//输出 17DC1DDB8C334D61A5499597CEC22D5E end;System.IOUtils.TPath.GetHomePath 返回用户的主路径。 beginMemo1.Lines.Add(TPath.GetHomePath);//输出 C:\Users\Administrator\AppData\Roaming end;System.IOUtils.TPath.GetRandomFileName 生成新的随机文件名。 beginMemo1.Lines.Add(TPath.GetRandomFileName);//输出 0EpRoGU5.7O1 end;System.IOUtils.TPath.GetTempFileName 生成一个唯一的临时文件。 varvFile: string; beginvFile : TPath.GetTempFileName;Memo1.Lines.Add(vFile);//输出 C:\Users\Administrator\AppData\Local\Temp\tmp8F56.tmp//不使用时删除DeleteFile(vFile); end;System.IOUtils.TPath.GetTempPath 返回系统临时目录的路径。 beginMemo1.Lines.Add(TPath.GetTempPath);//输出 C:\Users\Administrator\AppData\Local\Temp\ end;System.IOUtils.TPath.HasExtension 检查给定文件名是否有扩展名部分。 beginif TPath.HasExtension(ceshi.txt) thenMemo1.Lines.Add(包含扩展名);//输出 包含扩展名 if not TPath.HasExtension(D:\ceshi\新建文件夹\) thenMemo1.Lines.Add(不包含扩展名);//输出 不包含扩展名 end;System.IOUtils.TPath.HasValidFileNameChars class function HasValidFileNameChars(const FileName: string; const UseWildcards: Boolean): Boolean;检查给定文件名是否仅包含允许的字符。 UseWildcards 指定通配符是否被视为有效的文件名字符例如星号或问号。 beginif not TPath.HasValidFileNameChars(ceshi.txt, False) thenMemo1.Lines.Add(包含特殊字符);//输出 包含特殊字符 if TPath.HasValidFileNameChars(ceshi*.txt, True) thenMemo1.Lines.Add(包含通配符字符);//输出 包含通配符字符 end;System.IOUtils.TPath.HasValidPathChars class function HasValidPathChars(const Path: string; const UseWildcards: Boolean): Boolean;检查给定路径字符串是否仅包含允许的字符。 UseWildcards 指定通配符是否被视为有效的文件名字符例如星号或问号。 beginif not TPath.HasValidPathChars(D:\ceshi\新建文件夹, False) thenMemo1.Lines.Add(包含特殊字符);//输出 包含特殊字符 if TPath.HasValidPathChars(D:\ceshi\新建文件夹*, True) thenMemo1.Lines.Add(包含通配符字符);//输出 包含通配符字符 end;System.SysUtils.IncludeTrailingBackslash 返回带尾部分隔符的路径名。在 Windows 上为 \否则为 /。 注意包含此函数只是为了向后兼容。应改用 System.SysUtils.IncludeTrailingPathDelimiter。 System.SysUtils.IncludeTrailingPathDelimiter function IncludeTrailingPathDelimiter(const S: string): string;返回带尾部分隔符的路径名。在 Windows 上为 \否则为 /。 如果已经以尾部分隔符结尾则原样返回否则附加分隔符。 procedure TForm1.Button1Click(Sender: TObject); beginMemo1.Lines.Add(IncludeTrailingPathDelimiter(D:\ceshi\新建文件夹));//输出 D:\ceshi\新建文件夹\ end;System.IOUtils.TPath.IsDriveRooted class function IsDriveRooted(const Path: string): Boolean;检查给定路径是否是绝对路径并以驱动器号开头。 在 POSIX 上始终返回 false因为没有驱动器根。 beginif TPath.IsDriveRooted(D:\ceshi\新建文件夹\) thenMemo1.Lines.Add(绝对路径);//输出 绝对路径if TPath.IsDriveRooted(D:) thenMemo1.Lines.Add(绝对路径);//输出 绝对路径 end;System.IOUtils.TPath.IsExtendedPrefixed class function IsExtendedPrefixed(const Path: string): Boolean;检查给定路径是否包含扩展前缀。 以 \\?\或 \\?\UNC\ 为前缀的路径是 Windows 特有的长度可以非常大并且不限于 255 个字符 (MAX_PATH)。在路径前面加上 \\?\ 可以解决长度超过 255 个字符问题。\\?\ 告诉 Windows API 禁用所有字符串解析并将其后面的字符串发送到文件系统。可以超出 Windows API 强制执行的 MAX_PATH 限制。 在 POSIX 上始终返回 false因为没有扩展前缀。 beginif TPath.IsExtendedPrefixed(\\?\D:\ceshi\新建文件夹) thenMemo1.Lines.Add(包含扩展前缀);//输出 包含扩展前缀 end;System.SysUtils.IsPathDelimiter function IsPathDelimiter(const S: string; Index: Integer): Boolean;指示字符串中指定位置的字符是否为路径分隔符。在 Windows 上为 \否则为 /。位置索引从 1 开始。 beginif IsPathDelimiter(D:\ceshi\新建文件夹, 3) thenMemo1.Lines.Add(第3个字符为路径分隔符\);//输出 第3个字符为路径分隔符\ end;System.IOUtils.TPath.IsPathRooted 检查给定路径是否是绝对路径。 beginif TPath.IsPathRooted(D:\ceshi\新建文件夹\) thenMemo1.Lines.Add(绝对路径);//输出 绝对路径if TPath.IsPathRooted(\ceshi\新建文件夹) thenMemo1.Lines.Add(没有驱动器号开头的绝对路径);//输出 没有驱动器号开头的绝对路径if not TPath.IsPathRooted(ceshi\新建文件夹) thenMemo1.Lines.Add(相对路径);//输出 绝对路径 end;System.IOUtils.TPath.IsUNCPath 检查给定路径是否为 UNC 格式。UNC 格式路径以两个反斜杠字符为前缀例如\\computer\folder。 beginif TPath.IsUNCPath(\\192.168.1.1\ceshi) thenMemo1.Lines.Add(UNC格式);//输出 UNC格式if not TPath.IsUNCPath(\\192.168.1.1\ceshi) thenMemo1.Lines.Add(不正确的UNC格式);//输出 不正确的UNC格式 end;System.IOUtils.TPath.IsUNCRooted 检查给定路径是否是 UNC 根路径。 在 POSIX 上始终返回 false因为没有扩展前缀。 procedure TForm1.Button1Click(Sender: TObject); beginif TPath.IsUNCRooted(\\192.168.1.1\ceshi) thenMemo1.Lines.Add(UNC根路径);//输出 UNC根路径if TPath.IsUNCRooted(\\192.168.1.1\ceshi) thenMemo1.Lines.Add(UNC根路径);//输出 UNC根路径 end;System.IOUtils.TPath.IsValidFileNameChar 检查文件名字符串中是否允许使用给定字符。 Windows 中特殊字符 #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #30, #31, , *, /, :, , , ?, \, | MacOS, iOS, Android, Linux 中特殊字符 #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #30, #31, / , ~. beginif not TPath.IsValidFileNameChar(*) thenMemo1.Lines.Add(文件名中不能使用);//输出 文件名中不能使用 end;System.IOUtils.TPath.IsValidPathChar 检查路径字符串中是否允许使用给定字符。 beginif not TPath.IsValidPathChar(|) thenMemo1.Lines.Add(路径中不能使用);//输出 路径中不能使用 end;Vcl.FileCtrl.MinimizeName function MinimizeName(const Filename: TFileName; Canvas: TCanvas; MaxLen: Integer): TFileName;获取可以在有限大小的在画布上绘制的文件名和路径的缩写名称。 缩短 Filename使其可以在 MaxLen 长度限制内绘制。用点替换文件名路径部分中的目录直到生成的名称符合指定的像素长度。Canvas 是要呈现缩写名称的画布用于确定字体规格。 rebeginMemo1.Lines.Add(MinimizeName(D:\ceshi\新建文件夹\ceshi.txt, Self.Canvas, 150));//输出 D:\...\新建文件夹\ceshi.txt end;System.SysUtils.SameFileName 根据当前区域设置比较文件名。 与 AnsiCompareFileName 相同。 System.IOUtils.TPath.SetAttributes class procedure SetAttributes(const Path: string; const Attributes: TFileAttributes);设置文件或目录属性。 procedure TForm1.Button1Click(Sender: TObject); begin//设置文件为只读TPath.SetAttributes(D:\ceshi\新建文件夹\ceshi.txt, [TFileAttribute.faReadOnly, TFileAttribute.faHidden]);//设置目录为隐藏TPath.SetAttributes(D:\ceshi\新建文件夹, [TFileAttribute.faHidden]); end;System.IOUtils.TFile.CreateSymLink class function CreateSymLink(const Link, Target: string): Boolean;创建符号链接。 注意调用CreateSymLink时目标文件或目录必须存在。 在 Windows Vista 及更高版本的 Windows 上使用。 procedure TForm1.Button1Click(Sender: TObject); begin//相当于CMD命令 mklink D:\SymLink D:\ceshi\新建文件夹TFile.CreateSymLink(D:\SymLink, D:\ceshi\新建文件夹); end;
http://www.pierceye.com/news/121150/

相关文章:

  • 个人网站主页模板如何开一家网络营销公司
  • 网络管理系统密码吴中seo页面优化推广
  • 手绘风格的网站上海做网站cnsosu
  • 怎么做一个免费网站网站app的作用
  • iis 搭建网站品牌建设经验做法
  • 做国外的众筹网站有哪些wordpress小红书主题
  • 扩展名 网站百度资源共享链接分享组
  • 东莞市seo网络推广怎么样杭州seo关键词优化哪家好
  • 做网站用什么ui美观微信公众号调用WordPress
  • 用万网做网站企业做网站怎么做
  • 比较好的网站开发教学网站专业做视频的网站有哪些
  • 户外旅游网站模板网站开发需要看相关书籍
  • 建设高端网站的公司企业营销网站建设公司
  • 重庆建设工程信息网站重庆企业网站建设报价
  • 大兴模版网站开发公司哪家好unn建站
  • 工信部网站域名备案查询北京科技网站建设公司
  • 昆明做网站那家好自己动手做网站
  • 女生做seo网站推广北京海岸设计公司网站
  • 单位建设网站硬件拍摄制作宣传片企业
  • 网站做推广应该如何来做呢哪里推广柳州360优化
  • 淘宝网站的建设目的济宁网站建设 中企动力临沂
  • 小米商城网站建设浏览器广告投放
  • 网站制作论文致谢wordpress首页导航栏
  • 网站右下角调用优酷视频广告代码酒泉地网站推广
  • 武清做网站的wordpress选择php
  • 最潮流的网站开发脚本语言icp网站备案
  • 盘锦网站建设平台wordpress英文模板
  • f2c网站建设公司单位名称大全
  • 泉州最专业手机网站建设哪家好重庆网站备案注销
  • 网站素材类型传统网站有没有建设必要性