Hi All
I was hoping somebody could help me out with something I'm trying to figure out. I am a newbie, coding with VB.Net 2010 express.
I have a form which contains 2 CheckedListBox's and 2 buttons. The first button brings allows you to select files which will populate CheckedListBox1. This will populate CheckedListBox1 with the file locations and names of the multiple files/items.
As for CheckedListBox2, it is automatically populated from an xml file in form load, which populates CheckedListBox2 with multiple file locations from the xml file.
The xml file is very simple. It contains "name", "filepath", and "backuppath".
When you click on the second button, "GO", I want each "checked" item in CheckedListBox1 to be copied to the "filepath" for each "checked" item in CheckedListBox2. However, if the file already exists in the "filepath" it needs to copy and rename the file that is already in "filepath" and paste it into "backuppath", but the file needs to be renamed in the backuppath - original filename + timestamp. Once backed up, the original file in "filepath" needs to be deleted and replaced with the specified file from CheckedListBox1.
For each CheckedListBox1 item that is checked state, will need to be copied/backed up to each checked state item in CheckedListBox2.
Here is some very rough pseudocode to try and get my idea across:
For Each item in checkedlistbox1 (where checked state = true)
For Each item in checkedlistbox2 (where checked state = true)
if file exists in filepath
copy and rename (filename + timestamp) checkedlistbox1 item into checkedlistbox2.item.backuppath
delete original file in checkedlistbox2.item.filepath
copy/paste checkedlistbox1.item.location to checkedlistbox2.item.filepath
else
copy/paste checkedlistbox1.item.location to checkedlistbox2.item.filepath
Next
Next
I am a newbie. I can populate CheckedListBox1 and CheckedListBox2, but cant figure out how to do the transferrimg on the GO button.
Can anybody please help me with the code. It would mean alot to figure this out???
neomira
Sent from my X10i using Tapatalk
I was hoping somebody could help me out with something I'm trying to figure out. I am a newbie, coding with VB.Net 2010 express.
I have a form which contains 2 CheckedListBox's and 2 buttons. The first button brings allows you to select files which will populate CheckedListBox1. This will populate CheckedListBox1 with the file locations and names of the multiple files/items.
As for CheckedListBox2, it is automatically populated from an xml file in form load, which populates CheckedListBox2 with multiple file locations from the xml file.
The xml file is very simple. It contains "name", "filepath", and "backuppath".
When you click on the second button, "GO", I want each "checked" item in CheckedListBox1 to be copied to the "filepath" for each "checked" item in CheckedListBox2. However, if the file already exists in the "filepath" it needs to copy and rename the file that is already in "filepath" and paste it into "backuppath", but the file needs to be renamed in the backuppath - original filename + timestamp. Once backed up, the original file in "filepath" needs to be deleted and replaced with the specified file from CheckedListBox1.
For each CheckedListBox1 item that is checked state, will need to be copied/backed up to each checked state item in CheckedListBox2.
Here is some very rough pseudocode to try and get my idea across:
For Each item in checkedlistbox1 (where checked state = true)
For Each item in checkedlistbox2 (where checked state = true)
if file exists in filepath
copy and rename (filename + timestamp) checkedlistbox1 item into checkedlistbox2.item.backuppath
delete original file in checkedlistbox2.item.filepath
copy/paste checkedlistbox1.item.location to checkedlistbox2.item.filepath
else
copy/paste checkedlistbox1.item.location to checkedlistbox2.item.filepath
Next
Next
I am a newbie. I can populate CheckedListBox1 and CheckedListBox2, but cant figure out how to do the transferrimg on the GO button.
Can anybody please help me with the code. It would mean alot to figure this out???
neomira
Sent from my X10i using Tapatalk
Last edited: