Jump to content

Windows Service


jaferreira
 Share

Recommended Posts

Mas sabes pelo menos criar o template de um Windows Service, certo?

Para o instaler, adicionas uma installer class ao projecto. Em termos de configuração, se não quiseres complicar, é bastante simples.

Quanto à cena de verificar a pasta. Não uses o Timer. Experimenta utilizar um componente chamado FileSystemWatcher. Basicamente, ele vai-te despoletar eventos, quando alguma coisa acontecer aos ficheiros de uma determinada pasta. Não é difícil... de qualquer forma, alguma dúvida, é só dizer 😄

Oracle Certified Professional - AdministraçãoOracle Certified Professional - Pl/sqlMCPD - Microsoft Certified Professional DeveloperMCTS - Microsoft Certified Technology Specialist

Link to comment
Share on other sites

Boas,

No blog do @VbTuga tem um exemplo (em VB .NET) que podes facilmente adaptar para C#:

VB.NET: Windows Service + FileSystemWatcher

http://vbtuga.blogspot.com/2008/09/vbnet-windows-service-filesystemwatcher.html

---

Ou se preferir, no CodeProject tem outro exemplo, já em C# (em Inglês).

How to implement a simple filewatcher Windows service in C#

http://www.codeproject.com/KB/files/C__FileWatcher.aspx

Cumprimentos,

Caio Proiete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.