Creating Your First Windows Services Project

Open Visual Studio .NET and create a Windows Services project. Name the project LearningVBservice. You'll see that all you have in the Solution Explorer is a .VB file named Service1, along with the AssemblyInfo.vb file.

Click once on the designer to access the properties for the service. Change the ServiceName property from Service1 to UsageMonitor. Also change the (Name) property from Service1 to UsageMonitor. Now, double-click on the designer to access the code. You'll notice that the first line after the Imports statement is this:

Public Class UsageMonitor

If you expand the code the IDE generated for you, you'll notice that you have a Sub New, which is not surprising. However, you also have a ...

Get A Programmer's Introduction to Visual Basic® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.