C# windows service
-
I need to write a C# 2010 windows service that calls a console application at different times. Since I have not written a windows service before, can you tell me the following: 1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it? 2. How to you include a timer in the application so it executes at specified time periods? Can you tell me and/or point me to references that will answer these questions listed above for me
-
I need to write a C# 2010 windows service that calls a console application at different times. Since I have not written a windows service before, can you tell me the following: 1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it? 2. How to you include a timer in the application so it executes at specified time periods? Can you tell me and/or point me to references that will answer these questions listed above for me
sc steinhayse wrote:
1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it?
File > New > Project > Visual C# > Windows > Windows Service
sc steinhayse wrote:
2. How to you include a timer in the application so it executes at specified time periods?
Create a new class and instantiate it from the
OnStart
method (you'll find this created by default, just search for it). The new class will contain whatever logic you need.*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
I need to write a C# 2010 windows service that calls a console application at different times. Since I have not written a windows service before, can you tell me the following: 1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it? 2. How to you include a timer in the application so it executes at specified time periods? Can you tell me and/or point me to references that will answer these questions listed above for me
sc steinhayse wrote:
I need to write a C# 2010 windows service
Why? Explain me what you need to do that cannot be done from a console-app.
sc steinhayse wrote:
1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it?
There's my argumentation that you do not need a service :) A Windows-service is an application that runs without any user-interaction, and which runs before any users logs in. They usually run under a limited user-profile, and not the users' profile.
sc steinhayse wrote:
2. How to you include a timer in the application so it executes at specified time periods?
Yes, but you don't want to. Use the Windows Task Scheduler[^]; it's there to run a specific task at a specific time/interval.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
sc steinhayse wrote:
1. How do you setup a windows service initally? Is it a windows service a desktop application, console application, or what kind of an application is it?
File > New > Project > Visual C# > Windows > Windows Service
sc steinhayse wrote:
2. How to you include a timer in the application so it executes at specified time periods?
Create a new class and instantiate it from the
OnStart
method (you'll find this created by default, just search for it). The new class will contain whatever logic you need.*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
Do I need to setup a deployment package at the same time I setup the code proejct intitally?
-
Do I need to setup a deployment package at the same time I setup the code proejct intitally?
No, you can add it later. Don't get too used to the Setup and Deployment project in Visual Studio. It no longer exists in VS2012 as it's been replaced by InstallShield LE. Typically, setup projects are built and designed right along side the project it's going to be installing.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak