473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How To Scan A Folder Continuously For New Files

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.

Nov 21 '05 #1
8 4984
Hi,

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

Ken
-------------------
<ba**********@hotmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
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.
Nov 21 '05 #2
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!!

Nov 21 '05 #3
<ba**********@hotmail.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
<ba**********@hotmail.com> schrieb:
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.


How Do I...Watch file system changes?
<URL:http://samples.gotdotnet.com/quickstart/howto/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5
Many thanks Herfried, thats very helpful.

Nov 21 '05 #6
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?

Nov 21 '05 #7
One of the pitfalls of Linux!

"ba**********@hotmail.com" wrote:
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?

Nov 21 '05 #8
BW
if that's the case, you will have to poll the folder yourself to see if
there are new files.
<ba**********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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?

Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sally B. | last post by:
Hello, I searched, but couldn't find answers--probably because I'm not sure what this is called... Anyway, I have about 50 web pages and I want to have some JavaScript that will read in a list of...
2
by: Kausar | last post by:
Hello All, I want to know how to scan the files before uploading it to the server in ASP.NET 2.0 application. One work arround i thought is to allow to upload in some temporary folder then sacn...
2
by: Ronald S. Cook | last post by:
I'm wanting to scan all folders and files under a specified path (e.g. C:\Files). I know using System.IO I can use Directory.GetFiles to get a list of files under a folder, but how do I get the...
0
MMcCarthy
by: MMcCarthy | last post by:
This is a module that scans for files and folders on a specified path and describe them in comma separated values file in a text format. The information is stored in this file consecutively like:...
2
by: sunset85 | last post by:
Hi. I'm trying to scan linked source directory using "cscope" In normal case (without linked source directory), "cscope -R " works vety well. But when linked source directory included,...
3
by: =?Utf-8?B?Tkg=?= | last post by:
Hi, I am looking for some code that would scan a folder structure and files in those folders and display them on a web page so that people can click on the file links and open the files. There...
1
by: ckb | last post by:
Hi, I have to save a .xls file but i need to scan all the files in the particular folder before saving the file and prompt the user to replace the file if it already exists in the particular folder....
3
by: =?Utf-8?B?RGF2aWRN?= | last post by:
Hi, does anyone know if I can scan a subdirectory using wildcards? I do not see a way to do this using: string folder = @"C:\INPUT\CUSTOMERS\ID???BC.*" DirectoryInfo di = new...
0
by: =?Utf-8?B?VHVybnBpa2UgSVQ=?= | last post by:
So we have a Xerox x65 set up in all of our business centers. There is a an account ono the server called scanuser. Our networking guys cant figure out why ths account is getting locked out for no...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.