Using the ServiceBase Class in VB.net
By: Steven Holzner
The ServiceBase class is the base class for a Windows service. Here is the inheritance hierarchy of this class:
Object MarshalByRefObject Component ServiceBase
You can find the more notable public properties of ServiceBase objects in Table below and their more notable protected methods in Table. (This class has no non-inherited events.)
Property |
Means |
---|---|
AutoLog |
Specifies whether to record Start, Stop, Pause, and Continue commands in the event log. |
CanPauseAndContinue |
Gets/sets if you can pause and resume the service. |
CanShutdown |
Gets/sets if the service should be informed at system shutdown. |
CanStop |
Gets/sets if the service can be stopped. |
EventLog |
Gets an event log you can use to write to. |
ServiceName |
Gets/sets the name used to identify the service. |
Method |
Means |
---|---|
OnContinue |
Executes when a service resumes after being paused. |
OnPause |
Executes when a service pauses. |
OnPowerEvent |
Executes when the computer's power status changes, as when notebooks go into suspended mode. |
OnShutdown |
Executes when the system is shutting down. |
OnStart |
Executes when the service starts. |
OnStop |
Executes when a service stops running. |
Archived Comments
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Using Resume Next and Resume Line in VB.net
Using On Error GoTo 0 in VB.net
Getting an Exception's Number and Description in VB.net
Raising an Exception Intentionally in VB.net
Exception Filtering in the Catch Block in VB.net
Using Multiple Catch Statements in VB.net
Throwing an Exception in VB.net
Throwing a Custom Exception in VB.net
Changes in Controls from VB6 to VB.net
Unstructured Exception Handling in VB.net