在Delphi中判断一个文件的日期是否是当天的日期,
如果是当天的时间然后拷贝到别的盘上
如果是当天的时间然后拷贝到别的盘上
解决方案 »
- 关于{$IOCHECKS ON}的问题,高手帮帮忙,谢谢!!
- 请各位高手帮帮忙,有关时间提醒的问题!急。。。。。。。。。。。。。
- 兄弟们:以后千万不要栽在QQ上了!!
- Fastreport 的小问题。
- 怎么样删除掉treeview里面的所有节点???
- 求能在WIN2K下锁住WIN键的方法
- 关于Web Service的工作效率问题。
- d5转到d6程序不能执行怎么办?
- 哪位大虾遇到国Can not make a visible windows modal的错误!!!急死我了
- 哪里有第二方DX控件的 新的ExpressPrinting System 下载包括Report Links.(主要是找ExpressQuantumGrid的)?
- Delphi7.0问题
- 如何在COM中返回数据集?
begin
if Trunc(FileDateToDateTime(FileAge('C:\temp\temp.txt'))) = Trunc(Date) then
CopyFile('C:\temp\temp.txt', 'C:\temp\temp.bak', True);
end;
var
h: Integer;
D: TDateTime;
DD: TDate;
begin
h := FileCreate('F:\资料\StringToWideStringEx.txt');
D := FileDateToDateTime(FileGetDate(h));
DD := TDate(D);
if DD = TDate(Now) then
ShowMessage(DateToStr(DD));
FileClose(h);
end;
TimeType: Integer): TDateTime;
var
ffd:TWin32FindData;
dft:DWord;
lft,Time:TFileTime;
H:THandle;
begin
H:=Windows.FindFirstFile(PChar(sFileName),ffd);
case TimeType of
0: Time:=ffd.ftCreationTime;
1: Time:=ffd.ftLastWriteTime;
2: Time:=ffd.ftLastAccessTime;
end; //获取文件信息
if (H <> INVALID_HANDLE_VALUE) then
begin
//我们只查找一个文件,所以关掉"find"
Windows.FindClose(H);
//转换FILETIME格式成为local FILETIME格式
FileTimeToLocalFileTime(Time,lft);
//转换FILETIME格式成为DOStime格式
FileTimeToDosDateTime(lft,LongRec(dft).Hi,LongRec(dft).Lo);
//最后,转换DOStime格式成为Delphi's应用的TdateTime格式
Result:=FileDateToDateTime(dft);
end
else
result:=0;
end;