1. Create a new project
2. Scroll down and choose 'Windows Service' in place of 'Windows Application'
You'll end up with a blank project with two subs.. OnStart and OnStop. Pretty self explanatory. Think of the OnStart as a Sub Main(). If you want to use a time, use the timer control from the "Components" Section, as the other timer control from the Windows Forms section doesn't support multi threaded uses.
You can move your code over into the new project.
To use it, you'll have to "install it." To create an installer for it, first switch to the designer windows for Service1.vb. Then press F4 to get the properties window. At the bottom of the properties window, you'll have a hyperlink for "Add Installer."
You'll then get a new class called "ProjectInstaller" with two components, ServiceProcessInstaller and ServiceInstaller.
Select the ServiceProcessInstaller and change it's Account Property to LocalSystem.
Now, build the project. You'll end up with an .EXE file that is your service. To get it to show up in your list of Windows Services via the control panel, open your Visual Studio Command Prompt window and navigate to your app. Then type:
>installutil myservice.exe
Then, go to your Control Panel>Administrative Tools and double click your Services Icon.
You should see your app in the list of services... simply start it like any other to test. Or have your App-1 start it remotely.
--
James