当前位置:首页 > 网络编程 > 软件语言 > DELPHI > Delphi6函数大全(3)

Delphi6函数大全(3)

点击次数:46 次 发布日期:2008-11-09 08:45:11 作者:源代码网
源代码网推荐
广告载入中

<<Delphi6函数大全3-SysUtils.pas>>

首部 function FindNext(var F: TSearchRec): Integer; $[SysUtils.pas
功能 返回继续文件搜索
说明 搜索成功则返回0
参考 function Windows.FindNextFile
例子 <参见FindFirst>
━━━━━━━━━━━━━━━━━━━━━
首部 procedure FindClose(var F: TSearchRec); $[SysUtils.pas
功能 结束当前文件搜索
说明 不关闭查询会占用系统资源
参考 function Windows.FindClose
例子 <参见FindFirst>
━━━━━━━━━━━━━━━━━━━━━
首部 function FileGetDate(Handle: Integer): Integer; $[SysUtils.pas
功能 返回文件的修改时间
说明 读取失败则返回-1
参考 function Windows.GetFileTime
例子
///////Begin FileGetDate
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
begin
I := FileOpen(Edit1.Text, fmOpenRead);
if I < 0 then Exit;
SpinEdit1.Value := FileGetDate(I);
Edit2.Text := DateTimeToStr(FileDateToDateTime(SpinEdit1.Value));
FileClose(I);
end;
///////End FileGetDate
━━━━━━━━━━━━━━━━━━━━━
首部 function FileSetDate(const FileName: string; Age: Integer): Integer; overload; $[SysUtils.pas
首部 function FileSetDate(Handle: Integer; Age: Integer): Integer; overload; platform; $[SysUtils.pas
功能 返回设置文件的修改时间
说明 修改成功则返回0
参考 function Windows.SetFileTime
例子 SpinEdit1.Value := FileSetDate(Edit1.Text, DateTimeToFileDate(StrToDateTime(Edit2.Text)));
━━━━━━━━━━━━━━━━━━━━━
首部 function FileGetAttr(const FileName: string): Integer; platform; $[SysUtils.pas
功能 返回文件的属性
说明 读取失败则返回$FFFFFFFF
参考 function Windows.GetFileAttributes
例子 SpinEdit1.Value := FileGetAttr(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function FileSetAttr(const FileName: string; Attr: Integer): Integer; platform; $[SysUtils.pas
功能 返回设置文件的属性
说明 设置成功则返回0
参考 function Windows.SetFileAttributes
例子 SpinEdit1.Value := FileSetAttr(Edit1.Text, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━


首部 function FileIsReadOnly(const FileName: string): Boolean; $[SysUtils.pas
功能 返回文件是否只读
说明 文件不存在看作只读
参考 function Windows.GetFileAttributes
例子 CheckBox1.Checked := FileIsReadOnly(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function FileSetReadOnly(const FileName: string; ReadOnly: Boolean): Boolean; $[SysUtils.pas
功能 返回设置文件是否只读是否成功
说明 文件不存在则返回False
参考 function Windows.GetFileAttributes;function Windows.SetFileAttributes
例子 CheckBox1.Checked := FileSetReadOnly(Edit1.Text, CheckBox2.Checked);
━━━━━━━━━━━━━━━━━━━━━
首部 function DeleteFile(const FileName: string): Boolean; $[SysUtils.pas
功能 返回删除文件是否成功
说明 文件不存在则返回False
参考 function Windows.DeleteFile
例子 CheckBox1.Checked := DeleteFile(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function RenameFile(const OldName, NewName: string): Boolean; $[SysUtils.pas

源代码网推荐

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华