Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2007

Tip: Looking for answers? Try searching our database.

Implementing a "Smart" folder in Windows XP?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Noozer - 31 Oct 2007 05:26 GMT
I'm looking for a "smart folder" program to run on my Windows XP machine.
I'm not having any luck finding it and think the logic behind the program is
pretty simple, but I'm not sure how I'd implement this. I've done some VB6
programming and dabbled in VS.Net.

Can someone share some pointers in how I could implement the following?

Basically, you drag a file to the "smart" folder and, depending on the type
of file and settings for that folder, Windows automatically puts it to a
specific place on your computer. Each smart folder would also contain a
folder named "Unknown" for file types that it didn't know how to handle.

If you open the folder, the view contains a folder representing each
location that files could be moved to.

For example...

I have my smart folder on my desktop. My smart folder is set up to put .MP3
files at "C:\Music", .BAK files at "D:\Backups" and .GIF, .JPG and .PNG at
"C:\Pictures".

I have a file, "MyPic.JPG", on my desktop... I drag the .JPG and drop it on
the smart folder. POOF! It's now at "C:\Pictures\MyPic.JPG".

I double click my smart folder and Explorer opens up showing me the
following folders "Music", "Backups", "Our pictures" and "Unknown".

Now, I drag "README.TXT" from my desktop and drop it on the smart folder.
POOF! It's now at "...MyDesktop\SmartFolder\Unknown\README.TXT"

Now, I open the settings for my smart folder and tell it that I want all
".TXT" files to be stored at "C:\Text Files". I hit Apply and OK. Not much
has happened, but NOW I right click on the Unknown folder and choose "Try
again"... POOF! My previously unknow file is now at "C:\Text
Files\README.TXT"

..and the folder would be just as smart as Windows, warning when files
already exist and asking what you want to do (assuming you have the prompt
enabled).

So... any software out there that will do this? If not, any pointers on how
I might be able to write a utility using VB6 or VB.Net?
Spam Catcher - 31 Oct 2007 06:19 GMT
> So... any software out there that will do this? If not, any pointers
> on how I might be able to write a utility using VB6 or VB.Net?

I you want to write it yourself - you can use the FileSystem Monitor class
to inform your application of a change to the disk (in your case, dropping
a file in the directory).

While your smart folder idea seems "neat"... It doesn't seem practice. How
are you going to implement all the different business rules? i.e. Pictures
goes to the Picture folder, Readme.txt is unknown but HelloWorld.txt goes
to another folder? etc. etc.
Spam Catcher - 31 Oct 2007 06:20 GMT
> practice

practical :-)
Noozer - 31 Oct 2007 07:06 GMT
>> practice
>
> practical :-)

Practice makes prefect!
Noozer - 31 Oct 2007 07:06 GMT
>> So... any software out there that will do this? If not, any pointers
>> on how I might be able to write a utility using VB6 or VB.Net?
[quoted text clipped - 7 lines]
> goes to the Picture folder, Readme.txt is unknown but HelloWorld.txt goes
> to another folder? etc. etc.

Three ways so far... Filename matching (regex and Windows wildcards), file
extension and "File begins with 'xx xx xx xx xx' bytes. I'd also consider
more rules for processing ZIP files or directories dropped into a Smart
Folder, but haven't worked on the logic for them just yet.

Rules will be on a first match basis, or optionally, if the file matches
multiple rules it will create multiple copies (or only go to the first
matching rule and create shortcuts to any other matching rules). Rules might
even allow multiple destinations to allow for backup copies to be generated,
etc.

Each rule MUST have a destination location. Multiple rules can use the same
destination. A "Target not found! Create, Abort or Hold until target is
ready?" popup occurs if the target location is not available. The Smart
Folder would temporarily store the file(s) and watch for the destination
location to become available. Great for dragging stuff to, and then later
connecting a removable drive, or if you have network shares that aren't
always available.

The Smart Folder will also keep a log of just where it's put each file, so a
user can find a file if it doesn't end up where expected. Also keep track of
where the file came from, so a user can "restore" file(s) to their original
location later.

As far as the program itself... Windows will allow you to drag files and
drop them on an EXE for processing, providing a very simple trigger for the
program.

If the program is started without any command line parameters, it can assume
that the user simply chose to "open" the Smart Folder. This would show the
destination targets and allow access to settings, etc.

If the program is started WITH command line parameters, it can assume that
it is a list of files/folders/etc. that should be processed.

Yes, I've put a bit of thought into this... I just wish I knew enough VB,
C#, etc... to create the actual code. (What would be the best VS 2005
language to use for this, assume I was equally proficient in each?)

Thanks!
Spam Catcher - 31 Oct 2007 18:22 GMT
> Yes, I've put a bit of thought into this... I just wish I knew enough
> VB, C#, etc... to create the actual code. (What would be the best VS
> 2005 language to use for this, assume I was equally proficient in
> each?)

They're 99.9% identical because they use the same .NET framework. However,
C# does have 1 or 2 additional power features (pointers - not really used
unless you do a lot of native calls, and anonymous deletegates - VB.NET has
workarounds).

So the choice is upto you:-)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.