私は、一定の時間が経過した後、特定のフォルダーからファイルを削除し、正規表現または拡張子で一致するプログラムに取り組んでいます。files() が
files(0) = Nothing
files(1) = Nothing
files(2) = Nothing
ect....
今、それが書かれている方法で、私は配置することができます
Else
log(1) = data(1)
log(3) = "Array field empty"
InsertLog(log)
そして、プログラムはホールドと同じ数のファイルをログに記録しますfile(i) = Nothing
。これは冗長なデータベース レコードを作成するため、望ましくありません。ALL かどうかを判断files(i) = Nothing
し、そこにコードを配置してデータベースに挿入する方法はありますか?
'If log(3) is successful that means no files were old enough or deleted successfully
If log(3) = "Success" And IsArray(files) Then
For Each file In files
If Not file.IsNullOrEmpty(file) Then
'If files is actually something insert into the log
log(1) = file
InsertLog(log)
'could place else here
End If
Next
files = Nothing
Else
'If no files or error in directory perform this
log(1) = data(1)
InsertLog(log)
End If