[dba-VB] c# - Monitor folder and run application

jwcolby jwcolby at colbyconsulting.com
Sat Sep 19 14:16:53 CDT 2009


I looked at the monitor piece awhile back and it turns out there is an object in .Net that does the 
monitor for you.  It even generates an event for new items in the dir IIRC.

John W. Colby
www.ColbyConsulting.com


Max Wanadoo wrote:
> JC, no code to hand, but as you say this is dead easy if run from a form.
> Set the Timer to the frequency.
> 
> With the InTimer()
> Do a  dir() to see if its there.
> End of heartache
> 
> Waiting for my Lottery numbers to come up...
> 
> Have you any code for that..I will swap...
> Max
> 
> 
> -----Original Message-----
> From: dba-vb-bounces at databaseadvisors.com
> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: 19 September 2009 19:44
> To: VBA
> Subject: [dba-VB] c# - Monitor folder and run application
> 
> Just wondering if anyone has already done this and could send me a solution.
> 
> I need to monitor a folder and run an application if a file exists.
> 
> I have found code that runs an app and waits a time period for it to
> complete, closing the app if it 
> doesn't complete within that time period.
> 
> In addition to that I need the monitoring code, and all wrapped up in a
> single solution.
> 
> This doesn't appear too tough given all the code snipits out there but why
> reinvent the wheel if you 
> have done it.
> 



More information about the dba-VB mailing list