hi every body!!!
Thanks so much for read the topic, so
i have created a service windows, follow
http://msdn.microsoft.com/en-us/library/aa984464(v=vs.71).aspx[
^]
But, when i start my service, i have get message box same as :
---------------------------
Services
---------------------------
Windows could not start the ExampleService service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
---------------------------
OK
---------------------------
After, i have read mylogEvent : the contents
=========================================
The ExampleService service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.
A timeout was reached (30000 milliseconds) while waiting for the ExampleService service to connect.
=========================================
Here is my code in Service1.vb :
Imports System.ServiceProcess
Public Class ExampleService
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
ServicesToRun = New System.ServiceProcess.ServiceBase() _
{New ExampleService()}
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
End Sub
Public Sub New()
MyBase.New()
InitializeComponent()
If Not EventLog.SourceExists("MySource") Then
EventLog.CreateEventSource("MySource", "MyNewLog")
End If
EventLog1.Source = "MySource"
EventLog1.Log = "MyNewLog"
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
EventLog1.WriteEntry("In OnStart")
End Sub
Protected Overrides Sub OnStop()
EventLog1.WriteEntry("In OnStop.")
End Sub
End Class
===== Plz help me.
I don't known, why is accident!!!
Thanks so much
Have a nice day!