-1

what I want to do is write a program that listens wcf web service frequently , say once every half-hour, and updates db according to ws result.What is the proper way of writing that kind of program.Should I create an exe and make it a windows scheduled task or write a program that has an infinite loop , maybe a thread approach.What is your opinion ? Thank you for any help.

Davut Özcan
  • 109
  • 13

1 Answers1

2

You probably have to create a Windows Service Application:

Microsoft Windows services, formerly known as NT services, enable you to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface. These features make services ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer.

In order to implement a recurring event, you need to use the Timer Class.

On a second thought, supported by these references:

a scheduled task seems also a nice solution which fits your scenario.

In terms of available .NET libraries, there is no difference between the 2 alternatives.

Community
  • 1
  • 1
Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78
  • Thank you reply , but is there any restrictions of .net libraries if I use Windows Service Application.Can I get the advantage of .net libraries.I will use c# by the way. – Davut Özcan Oct 31 '13 at 09:23
  • Yes you can use the .NET libraries and write it in C# – Jocke Oct 31 '13 at 09:39