I_R_Lee Posted December 22, 2002 Posted December 22, 2002 I know how to get files and directories from a specific place, but how do you get all of the files and directories on an entire drive? Quote
*Gurus* divil Posted December 22, 2002 *Gurus* Posted December 22, 2002 Make a function which loops through all folders in a given directory and also all files. When it encounters a folder, make it call itself with that folder as well as performing any other actions you need. I'm pretty sure there's an example in the vb.net code examples site I posted in the knowledge base. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Volte Posted December 22, 2002 *Experts* Posted December 22, 2002 One thing to keep in mind though is that if you have a very large drive, something like this will take absolutely ages to run start to finish. Unless you are making some sort of virus scanner or something that needs to look at all the files in one go, avoid this. If you are making some kind of explorer, get all the folders in C drive's root to start off. Then when the user opens another folder, get the contents of that folder, etc etc. Quote
I_R_Lee Posted December 22, 2002 Author Posted December 22, 2002 Thanks. I'm making a fake joke virus scanner thing. Would it be possible to actually turn it into a real virus scanner using only VB .NET? Quote
*Experts* Volte Posted December 22, 2002 *Experts* Posted December 22, 2002 I wouldn't even go there. That'd be a massive project. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.