使用PB调用API自动更新(非FTP模式)(二、API说明及定义(2))
5、CompareFileTime function ulong CompareFileTime( REF s_filetime lpFileTime1, REF s_filetime lpFileTime2) library "kernel32.dll" Alias for "CompareFileTime" VB 声明 Declare Function CompareFileTime Lib "kernel32" Alias "CompareFileTime" (
5、CompareFileTime
function ulong CompareFileTime( REF s_filetime lpFileTime1, REF s_filetime lpFileTime2) library "kernel32.dll" Alias for "CompareFileTime"
VB声明 |
Declare Function CompareFileTime Lib "kernel32" Alias "CompareFileTime" (lpFileTime1 As FILETIME, lpFileTime2 As FILETIME) As Long |
说明 |
根据FILETIME结构的信息,对比两个文件的时间 |
返回值 |
Long,如两个时间相等,就返回零;如lpFileTime1小于lpFileTime2,返回-1;如lpFileTime2小于lpFileTime1,返回1 |
参数表 |
参数 |
类型及说明 |
lpFileTime1 |
FILETIME,参考FILETIME |
lpFileTime2 |
6、CopyFileA
function ulong CopyFileA(string lpExistingFileName, string lpNewFileName, long bFailIfExists) library "kernel32.dll" Alias for "CopyFileA"
VB声明 |
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long |
说明 |
复制文件。与vb的filecopy命令相似 |
返回值 |
Long,非零表示成功,零表示失败。会设置GetLastError |
参数表 |
参数 |
类型及说明 |
lpExistingFileName |
String,源文件名 |
lpNewFileName |
String,目标文件名 |
bFailIfExists |
Long,如果设为TRUE(非零),那么一旦目标文件已经存在,则函数调用会失败。否则目标文件被改写 |
原文转自:http://www.ltesting.net
|