How To Scan A Folder Continuously For New Files

  • Thread starter Thread starter batballs2002
  • Start date Start date
B

batballs2002

I am very new to VB.Net and I have been asked to write an application
that scans for new files in a certain network folder and then process
the file. I need some help with getting the code started.

The steps invovved are:

1/ Files are deposited on a network folder throughout the day.
2/ The application would take each new file and append to a SQL Server
database and then move to an archive folder.

Any help would be much appreciated, many thanks in advance.
 
Hi,

Take a look at the file system watcher.
http://msdn.microsoft.com/library/d.../frlrfsystemiofilesystemwatcherclasstopic.asp

Ken
-------------------
I am very new to VB.Net and I have been asked to write an application
that scans for new files in a certain network folder and then process
the file. I need some help with getting the code started.

The steps invovved are:

1/ Files are deposited on a network folder throughout the day.
2/ The application would take each new file and append to a SQL Server
database and then move to an archive folder.

Any help would be much appreciated, many thanks in advance.
 
Thanks Ken, I get the gist of this, however is there something very
basic on the net that would give a more step by step guide. As I said
I new to VB.net progamming and finding it a very steep learning curve!!
 
I am very new to VB.Net and I have been asked to write an application
that scans for new files in a certain network folder and then process
the file.

You can use the FileSystemWatcher component (available in VS.NET's toolbox)
to watch for changes in a folder. Classes/methods for copying/... files can
be found in the 'System.IO' namespace.
 
One thing I forgot to mention is that the files are being stored on a
linux server, and file watching does not seem to pick up the new files
when they are placed on that folder. Has anyone had any experience
with Linux folders?
 
if that's the case, you will have to poll the folder yourself to see if
there are new files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top