Newbie here need help with listbox

wire

New member
Joined
May 30, 2009
Messages
3
Programming Experience
Beginner
OK first off i looked everywhere and i did find guides but because i am now starting with programming it is being very difficult for me to modify existing code to suit my needs.
I need a simple program (I hope it is simple).

Program use:
A list box to show the contents of a folder (lets say c:\music). If a user double click an item from the listbox it will be copied to a mapped drive and it will overwrite if exist.

Please if possible just give me the code for me to cut and paste and I will figure it out ( if possible with my limited knowledge )

Thanks again...PS: I am trying very hard to learn this but i can't find a book that will teach from the beginning without any prior knowledge.
 
Last edited:
1) Show the contents of a folder: put an OpenFileDialog on your form.
2) Copy the file: use the File.Copy function.
 
thanks for your reply but as i said i am a newbie ...I have no idea what you mean..can you give me the code ...then if it works for my needs ..i will take the time to figure it out as i learn more as for now can you please give me the entire code so i can cut and paste it...Thanks so much
 
Open File Dialog:
1) you get this from the "Dialog" portion of your toolbox.
2) show dialog:
<dialog control name>.ShowDialog()
3) get user selection:
<variable> = <dialog control name>.FileName

Copy File:
1) above "Public Class <whatever>", type: Imports System.IO
2) copy command:
File.Copy(<file you want to copy>, <place to copy it to>)
 
Back
Top