使用VB6爲什麼我的循環只刪除一個文件?
在一個文件夾,我有文件的n個,我想刪除一個0 KB文件
代碼
Dim filename5 As String
filename5 = Dir$(txtsourcedatabasefile & "\*_*", vbDirectory)
MsgBox filename5
Do While filename5 <> ""
If FileLen(txtsourcedatabasefile & "\" & filename5) = 0 Then
Kill txtsourcedatabasefile & "\" & filename5
End If
Loop
txtsourcedatabasefile - 路徑
上面的代碼是隻刪除一個文件,其餘文件不刪除。將錯誤顯示爲未找到文件。
我的代碼有什麼問題?
需要VB6代碼幫助