detecting changes in a directory
I have worked with PHP and other programming languages but I am new to VB. I want to write an application that is run manually every day, and each time it is run it checks for modified and newly created files in a particular folder
what is the best way to do this?
Re: detecting changes in a directory
if you can leave your application open all the time you use the FileSystemWatcher class, if not you'll have to save all the files size that you need to check and comparing them each time your application is running.
Re: detecting changes in a directory
You would have to have stored information about the previous contents of the folder in order to know what is new and what has been modified. You first need to decide what data you need to store and where you're going to store it. You would then want to look at using the Directory, File, DirectoryInfo and FileInfo classes from the System.IO namespace to get information about files in a folder.
Re: detecting changes in a directory
thanks guys, but where do I save information about the files. in a database maybe?
Re: detecting changes in a directory
Quote:
Originally Posted by
techfish
thanks guys, but where do I save information about the files. in a database maybe?
That's up to you. A database is certainly one option. You could also use an XML file, a CSV file, etc, etc.