How To Do This?

kazmax

Member
Joined
Sep 24, 2005
Messages
8
Programming Experience
10+
I am new to developing with .NET, but have been trained so I know my way around and can development basic programs no problem. I would appreciate thoughts on the general direction that development might take with respect to the following.

Text files arrive at a network location from a third party application. We can't control or modify that application, so we must rely upon checking the network location every so often (every half hour would be fine) to see if a new file has been deposited.

When a file arrives it needs to be opened and the contents (which are in comma delimited format) transferred to a SQL Server database. This isn't rocket science.

The opening and transfer of information to a SQL Server database doesn't cause me any problem. However I'm wondering what the best approach is with regard to discovering whether files have arrived.

From my VB6 days I might have been tempted to create an EXE with a timer which checked a directory location every half hour. However with the myriad of options that .NET brings I'm wondering whether some sort of service application would be the right direction to proceed in.

This application doesn't need a user interface, it literally has to sit on the server 24x7 monitoring a network location and carrying out a known task when a file arrives. Because this is not user orientated I consider it to be a simple service application which needs to come up when the server is rebooted.

If someone could point me in a general direction that should be good enough for now.

Thanks in anticipation!
 
Hey kazmax,

A windows service would be a lovely way to implement this. You could check out the link:

http://www.developerfusion.co.uk/show/3441/2/

This shows you how to make a windows service with a timer.
You can then import system.IO and use the File.Exists function to determine that the file is present.

The only drawback to using a service is that it won't be able to run on anything below NT.
 
Back
Top