关于FILETIME的比较

一直对FILETIME中的参数不太了解是什么意思, 也不知道怎么比较先后,之前都是转成systemtime再比较,感觉有点麻烦。终于发现有个API可以直接比较,CompareFileTime,具体的可以查MSDN。

 

CompareFileTime

 

The CompareFileTime function compares two file times.

 

LONG CompareFileTime(
  const FILETIME* lpFileTime1,
  const FILETIME* lpFileTime2
);

Parameters

lpFileTime1
[in] Pointer to a FILETIME structure that specifies the first file time.
lpFileTime2
[in] Pointer to a FILETIME structure that specifies the second file time.

Return Values

The return value is one of the following values.

Return valueDescription

-1
First file time is earlier than second file time.

0
First file time is equal to second file time.

1
First file time is later than second file time.
发布了15 篇原创文章 · 获赞 15 · 访问量 9万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章