There is a program that I'm doing and what it does is move a chosen file/folder to a folder on drive "C:\test" and I have a list box that only display the files name inside the Test folder and when the user click the file name on a listbox its then copies the selected file to Desktop but I have 2 problem:
1) The folders can be moved in to the test directory but I don't know how to make the folder name(s) that are inside the test file be displayed on a listbox but without the path it has to be only the folder(s) name.
2) The listbox displays every file but not folders that are inside the test folder even if the file is inside another folder inside the test file the file is displayed but here it come a problem: let say inside the test folder I have another file called 123 and inside the 123 folder I have a file maybe named test.txt the test.txt will be shown on the listbox but when I click it to download it the error is produced and the reason for the error is that I coded it like this:
Dim downld As String = "C:\test\" + ListBox1.SelectedItem
IO.File.Copy(downld, My.Computer.FileSystem.SpecialDirectories.Desktop & "\" & System.IO.Path.GetFileName(downld), True)
Now the problem as you can see is that I can only or I only pointed it to look inside the known directory which is "C:\test" but I can't point it to 123 or look inside the directory 123 so that it will find the file named test.txt so my question is that how can I get a full path of a selected item in a listbox so that I can use it to locate the file and copy it.
Ow what I just think I have to enlighten is that the folders inside the test folder are folders that a user has chosen to move then to the test folder so I can't manually write a folder name in code because the user won't use the same name.