Results 1 to 2 of 2

Thread: Windows Service

  1. #1

    Thread Starter
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Question Windows Service

    Howdy all,

    I have done single windows service applications before but this time I want to expand my knowledge on windows services but kinda got stuck. I am confused where to start on this project of mine but basically I want to be create an application that can create / delete windows service(s) that are related to the application itself. Each service in the application is able to watch a directory and based on the parameters that are set for the service, it will be able to delete the files on it

    For example, the application is called GS.
    The first task of it is to create the following:
    1. service to be called GS:Service1 and its task is to watch C:\TestOne\ and delete all text files in this directory that are older than 7 days
    2. service to be called GS:Service2 and its task is to watch D:\TestSample\Dir\ and delete all files and subdirectories on there that are older than 3 months

    Once the services are created in the app, you will be able to see the service status on the app where you can start / stop the service as well as modify the parameters that was set on it.

    I have no problem in creating just a static service but I have a problem creating multiple services Can anyone point me in the right direction please? Really would appreciate any help on this.

    Thanks in advance,
    Greyskull
    Please go to the Thread Tools menu and click Mark Thread Resolved when your post is answered
    If someone helped you today then please consider rating their post.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Windows Service

    Each service would be its own project with its own installer added. Your application can then execute that installer at the commandline, either directly by redirecting stdin or vis a batch file. You can then use a ServiceController object to control the service. ServiceController is a component so it can be added to a form in the designer if desired.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width