gust2012
26-03-2011, 23:06
Tôi có đoạn COde như sau:
For Each s As String In chkList_Info.SelectedItems
Dim f As New DirectoryInfo(Application.StartupPath & "\" & s)
File.Delete(f.ToString() & "\" & chkListbox_filename.SelectedItem)
Next
f chứa đường dẫn đầy đủ đến file cần xóa
vd: f=".../Bin/Debug/s/tenfile.jpg"
Lưu ý: s sẽ bằng là b cho thông báo lỗi bên dưới
khi thực thi thì chương trình báo lỗi như sau:
The process cannot access the file '\bin\Debug\b\HoaAnhTuc.jpg' because it is being used by another process.
Mong các bác giúp cho ! Cảm ơn các bác rất nhiều !
Thân !
For Each s As String In chkList_Info.SelectedItems
Dim f As New DirectoryInfo(Application.StartupPath & "\" & s)
File.Delete(f.ToString() & "\" & chkListbox_filename.SelectedItem)
Next
f chứa đường dẫn đầy đủ đến file cần xóa
vd: f=".../Bin/Debug/s/tenfile.jpg"
Lưu ý: s sẽ bằng là b cho thông báo lỗi bên dưới
khi thực thi thì chương trình báo lỗi như sau:
The process cannot access the file '\bin\Debug\b\HoaAnhTuc.jpg' because it is being used by another process.
Mong các bác giúp cho ! Cảm ơn các bác rất nhiều !
Thân !