Hi,
I have a code to delete the file which is based from listbox data,
Dim fileName As String
Dim file,filex As FolderItem
dim f as folderitem
dim t as textinputstream
dim p as string
f=getfolderitem("//data/")
t=textinputstream.open(f)
p=t.readline
t.close
For i As Integer = 0 to Listbox7.ListCount - 1
file = getfolderitem(p).child("data").child(Listbox7.Cell(i, 2) +".odr")
filex = getfolderitem(p).child("data").child(Listbox7.Cell(i, 2) +".done")
If file <> nil and file.Exists Then
file.CopyFileTo filex
End If
If file <> nil and file.Exists Then
if Listbox7.cell(i,0)<>tgl.text then
file.Delete
end if
End If
next
before was running when I put the code
If file <> nil and file.Exists Then
file.Delete
end if
End If
next
I dunno why it wont remove the file anymore since I put this line to monitoring the date.
if Listbox7.cell(i,0)<>L_date.text then
If file <> nil and file.Exists Then
//listbox7 col 0 was the date and col 2 was the filename of the file to delete.
if Listbox7.cell(i,0)<>L_date.text then
file.Delete
end if
End If
next
[/code]
any helps.?
thanks
Regards,
Rivo