读书人

难题 FILETIME结构中的dwHighDateTime

发布时间: 2012-03-30 17:32:09 作者: rapoo

难题 FILETIME结构中的dwHighDateTime 和 dwLowDateTime 是如何转换为年月日的?
注意:我问的是它转换的算法。不是用哪个API转换。

[解决办法]

MSDN:The FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601.

[解决办法]
Currency 就是 64位定点小数,不用任何转换。
VB code
Private Declare Function GetFileTime Lib "kernel32" ( _                                    ByVal hFile As Long, _                                    lpCreationTime As Currency, _                                    lpLastAccessTime As Currency, _                                    lpLastWriteTime As Currency) As LongPrivate Sub Form_Load()   ...   Dim fCTime As Currency   Dim fATime As Currency   Dim fWTime As Currency   ...   GetFileTime fs, fCTime, fATime, fWTime
[解决办法]
你没看到老鸟的代码吗?
lpCreationTime As Currency,
API声明变了,
FILETIME是8字节,Currency也是8字节,所以可以代替!

读书人网 >VB

热点推荐