以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 请老师看看代码,两个日期比较明明是一样,if 语句还会往下执行 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=178831) |
-- 作者:fvcfox -- 发布时间:2022/7/22 23:48:00 -- 请老师看看代码,两个日期比较明明是一样,if 语句还会往下执行 Dim si As String For Each ff As String In FileSys.GetFiles (ProjectPath & "temp\\") Dim ifo As New FileInfo(ff) Dim i As Integer = ifo.Length Dim fs As DataRow = DataTables("fl").SQLFind("合成名=\'" & ifo.Name & "\'") If fs IsNot Nothing AndAlso ifo.LastWriteTime > CDate(fs.SQLGetValue ("修改日期")) Then \'如果找到符合条件的行 MessageBox.Show( ifo.LastWriteTime & chr(13) & CDate(fs.SQLGetValue ("修改日期"))) If i < 1024 Then si = i & " B" ElseIf 1048576 > i AndAlso i >= 1024 Then si = round2(i / 1024, 2) & " KB" ElseIf 1073741824 > i AndAlso i >= 1048576 Then si = round2(i / 1024 / 1024, 2) & " MB" ElseIf 1099511627776 > i AndAlso i >= 1073741824 Then si = round2(i / 1024 / 1024 / 1024, 2) & " GB" End If fs.SQLSetValue ("大小", si) fs.SQLSetValue ("修改日期", ifo.LastWriteTime) ShowWaitDialog(New Operation(Function() As Boolean \'等待开始 fs.SQLInsertFile("fl", ff) \'插入文件 End Function), Nothing) \'等待结束\' End If Next DataTables("fl").Load
|
-- 作者:有点蓝 -- 发布时间:2022/7/23 8:54:00 -- 肯定不一样 msgbox(format(ifo.LastWriteTime,"yyyy-MM-dd HH:mm:ss.ffffff")) dim d as date = fs("修改日期")
msgbox(format(d,"yyyy-MM-dd HH:mm:ss.ffffff")) |