目前我是使用如下方法判断文件的修改情况的,但有个缺点就是占内存If DataTables("dbupdate").DataRows.Count > 0 Then
For Each dr As DataRow In DataTables("dbupdate").DataRows
System.Threading.Thread.Sleep(500)
Dim tb As Table = Tables(dr("所在表"))
Dim ifo As New FileInfo(dr("nf"))
dr("更新时间") = cstr(ifo.LastWriteTime)
If FileisOpened(dr("nf")) = False Then
If FileOpened(dr("nf")) = False Then
If dr("更新时间") > dr("登记时间") And dr("不上传") = False Then
Try
tb.DataTable.ReplaceFor ("文件时间" , CStr(ifo.LastWriteTime), "服务器文件名='" & dr("服务器文件名") & "'")
If ftp1.Upload (dr("nf"), dr("类别") & dr("服务器文件名"), True) = True Then
tb.DataTable.ReplaceFor ("不上传" , False , "服务器文件名='" & dr("服务器文件名") & "'")
End If
dr.Delete
DataTables("dbupdate").Save
Catch ex As Exception
End Try
ElseIf dr("更新时间") = dr("登记时间") Then
dr.Delete
DataTables("dbupdate").Save
End If
End If
End If
Next
Else
MyTimers("监视flup").Enabled = False
End if