특정 시간이 경과 한 후 특정 폴더에서 파일을 삭제하는 프로그램에서 작업하고 있으며 정규 표현식이나 확장자를 사용하여 일치시킬 수 있습니다. 파일() 지금이 기록되는 방식배열이 비어있는 경우 유효성을 검사하는 방법
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
당신은 [File.GetLastWriteTime]에서 볼 수 없습니다 (http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetime.aspx)? – billinkc