PDA

Click to See Complete Forum and Search --> : Is this possible to be created?


silvideo
Dec 8th, 2009, 02:56 PM
Hi, I am wondering if it would be possible to create a program that upon being launched it would scan the contents of a designated folder residing in the same directory as the exe file and upon finding any files in that folder it would add them to the form as buttons that could be clicked to open those files.
As an example: if a text file (hello world.txt) and an mpeg file (my movie.mpg) are inside the folder upon double clicking the exe and launching the program, they would appear on the form as two buttons; one would be named "hello world.txt" and the other "my movie. mpg") with or without the extension letters.
Once one button is clicked, the file would open in notepad or WMP.
The way I envision this program is as a dynamic program that would add or subtract buttons every time it is launched depending on the files inside the folder.
Using VB 2008.
thank you for your input
silvio facchin
{email removed}

techgnome
Dec 8th, 2009, 03:15 PM
In short, yes it's possible.

Using a DirectoryInfo class and the FileInfo class, it would be very easy to do.

-tg

silvideo
Dec 8th, 2009, 03:37 PM
thank you for your reply, I am very new to all this; would you mind elaborating on how to exactly do it?:blush:
thank you again.
silvio.

koolsid
Dec 14th, 2009, 04:33 AM
@silvideo: Do you want help in making this or do you want someone to make it for you?

silvideo
Dec 14th, 2009, 09:06 AM
I would appreciate if someone could write it for me.

JoshHilton
Dec 15th, 2009, 04:48 AM
I can get on that tomorrow. Should only take a few minutes.

gonzalioz
Dec 16th, 2009, 09:50 AM
Hi Silvideo,

I don't know if JoshHilton made your application already, but I've made one as well. It was a good exercise and fun to do so couldn't resist it :). I uploaded it to rapidshare:

http://rapidshare.com/files/321675249/Silvideo.zip

Hope you like it!

ps: I didn't use buttons, hope you don't mind. I think this is much more user friendly then a load of buttons. If you still want them, let me know.