计算机二级DELPHI函数:delphi部分操作文件函数计算机二级考试

文章作者 100test 发表时间 2009:05:07 18:06:54
来源 100Test.Com百考试题网


  2009年下半年全国计算机等级考试你准备好了没?考计算机等级考试的朋友,2009年下半年全国计算机等级考试时间是2009年9月19日至23日。更多优质资料尽在百考试题论坛 百考试题在线题库
  都是一些基础的文件函数,刚学习DELPHI的朋友可以收藏一下,方便以后使用的时候查询。
  1、返回文件扩展名
  function ExtractFileExt(const FileName: string): string.
  2、返回文件名
  function ExtractFileName(const FileName: string): string.
  返回应用程序的文件名
  function ExtractFileName(ParamStr(0)): string.
  返回应用程序的路径
  function ExtractFilePath(ParamStr(0)): string.
  3、检测文件是否存在
  function FileExists: Boolean.
  4、查找目录中是否存在某一文件
  function FileSearch(const Name, DirList: string): string.
  5、返回路径名
  function ExpandFileName(const FileName: string): string.
  6、返回文件大小
  function FileSize(var F): Integer.
  7、返回上上一次I/O操作的状态
  function IOResult: Integer.
  8、返回文件属性
  function FileGetAttr(const FileName: string): Integer.
  9、设置文件属性
  function FileSetAttr(const FileName: string. Attr: Integer): Integer.
  10、设置文件的DOS日期戳
  On Windows:
  function FileSetDate(Handle: Integer. Age: Integer): Integer. overload.
  Cross-platform:
  function FileSetDate(const FileName: string. Age: Integer): Integer. overload.
  11、返回文件的DOS日期戳
  function FileGetDate(Handle: Integer): Integer.
  12、把Delphi日期格式转化为DOS日期格式
  function DateTimeToFileDate(DateTime: TDateTime): Integer.
  13、把DOS日期格式转化为Delphi日期格式
  function FileDateToDateTime(FileDate: Integer): TDateTime.
  14、 修改文件扩展名
  function ChangeFileExt(const FileName, Extension: string): string.
  15、删除文件
  function DeleteFile(const FileName: string): Boolean. (SysUtils)
  16、打开文件
  function FileOpen(const FileName: string. Mode: LongWord): Integer.(SysUtils)返回为文件句柄
  打开模式:fmOpenRead fmOpenWrite fmOpenReadWrite fmShareCompat fmShareExclusive fmShareDenyWrite fmShareDenyRead fmShareDenyNone
  17、把光标定位到某一点
  function FileSeek(Handle, Offset, Origin: Integer): Integer. overload.
  function FileSeek(Handle: Integer. const Offset: Int64. Origin: Integer): Int64. overload.
  Offset为偏移量
  Origin为开始模式
  Origin Action
  0 The file pointer is positioned Offset bytes from the beginning of the file.
  1 The file pointer is positioned Offset bytes from its current position.
  2 The file pointer is positioned Offset bytes from the end of the file.
  18、把文件读到缓冲区
  function FileRead(Handle: Integer. var Buffer. Count: Integer): Integer.
  19、关闭文件
  procedure FileClose(Handle: Integer).

  2009年上半年全国计算机等级考试参考答案请进入计算机考试论坛

  2009年全国计算机等级考试报名信息汇总

  2009年NCRE考试有新变化

  2009年全国计算机等级考试-大纲

  2009年上半年全国计算机二级考试试题及答案

  2009年上半年全国计算机等级考试试题答案汇总



相关文章


计算机二级DELPHI函数:Win32API使用特殊情况计算机二级考试
计算机二级DELPHI函数:调用控制面板设置功能计算机二级考试
计算机二级DELPHI函数:delphi自删除函数DeleteMe计算机二级考试
DELPHI函数:Delphi中求两个时间差值代码计算机二级考试
计算机二级DELPHI函数:delphi部分操作文件函数计算机二级考试
计算机二级DELPHI函数:Delphi的四舍五入函数计算机二级考试
计算机二级DELPHI函数:Format的使用方法计算机二级考试
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛