Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# windows service

C# windows service

Scheduled Pinned Locked Moved C#
csharptutorialquestionworkspace
5 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sc steinhayse
    wrote on last edited by
    #1

    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

    P L 2 Replies Last reply
    0
    • S sc steinhayse

      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

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • S sc steinhayse

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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[^]

        1 Reply Last reply
        0
        • P Pete OHanlon

          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

          S Offline
          S Offline
          sc steinhayse
          wrote on last edited by
          #4

          Do I need to setup a deployment package at the same time I setup the code proejct intitally?

          D 1 Reply Last reply
          0
          • S sc steinhayse

            Do I need to setup a deployment package at the same time I setup the code proejct intitally?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups