polling

  • Thread starter Thread starter ba.hons
  • Start date Start date
B

ba.hons

Hi all

I am new(ish) to c# and was wondering if anyone would help me?

I want to create an application that polls a specific directory all the
time and when it finds an XML file has been placed in the directory, it
reads the XML file and deletes the file from that directory.

Am wondering what would be the best (most effcient) way of doing this?
e.g. a thread, timing event???

If anyone knew of any examples of anything like this which i could use
a starting point i would really appreciate it.

Thanks In Advance

Adam
 
Thanks for the advice this seems ideal for what am trying to do.

Would you think it was better to run this as a windows service if it
will be running constantly?

I realise that question may be a little vague and i might just need to
develop an exe and a service to see which works better, what i would
really like is for it to have its own taskbar icon which sits next to
the system clock?

thanks

Adam
 
Hi Adam,
Thanks for the advice this seems ideal for what am trying to do.

Would you think it was better to run this as a windows service if it
will be running constantly?

The FileSystemWatcher component is commonly used in services, although it
can certainly be used in WinForms applications as well.
I realise that question may be a little vague and i might just need to
develop an exe and a service to see which works better, what i would
really like is for it to have its own taskbar icon which sits next to
the system clock?

If you need a GUI then you'll have to use a WinForms application since a
Windows Service will not run in the foreground, preventing you from
displaying a Form or even a taskbar icon.
 
Back
Top