How to delete files in Visual Basic with a CheckedListBox1
Hello, I was wondering how I can make my form look for files in a directory (Let's say.. Combat Arms or something) And it'll look for.. let's say text files.. How can I have that text file (Or name I guess I can say) Go into the CheckedListBox1 (Example inside of CheckedListBox1 it says the text name and the directory:"C:\Game\Combat Arms\Filename.txt or .exe or .jpg etc. etc.") and I can check it and click the "Delete" button and it'll delete the file from the directory and it'll clear from the CheckedListBox1.. If you can help me I'll be more then thankful and more then just happy(: (Sorry if this was hard to understand.. I'm just very tired and in a hurry)

He wants to know everything from "finding" the files, to adding them to the checkbox, to removing items from it. It's not 1 question, its a "please give me code which does ___ ___ & ____".
-And has 'no thoughts on how' to accomplish this -- he wants copy-pastable code.
If there is an error, 'I' will not be increased, and an infinite loop will happen because the same index will be used in the next iteration: and fail, and loop. ?
Add 'Finally' block and move "I++" to that? or initialize 'I' to -1 and move "I++" before the function call. ?
Even if it didn't loop forever,on error 'I' won't be incremented, so 'I' won't correctly correspond to the next item in the list.
Yep, not sure what I was thinking: it won't infinite loop, but 'I' is still not incremented as it should.
I forget if .SelectedItems () is 0 or 1 based (intellisense will tell you) : if it's 0 based, and you move I++ before the function call, you must initialize I to -1 or you'll skip item (0). If it's 1 based, initialize it to 0.