.NET 3.5에 작은 Windows 서비스를 작성하려고합니다.이 파일은 "C : \ demofolder"의 새 파일 인 경우 10mn마다 확인한 다음 전자 메일을 보냅니다.Windows 서비스
이 하위 홈페이지 '보다 더 선언 : 지금까지 내가 다음 코드처럼 여기까지 만든 다음, 공공 하위 새로운 기능 오류()
Imports System Imports System.Timers Imports System.ServiceProcess Public Class TestMyService ' A timer that controls how frequenty the example writes to the ' event log. Private serviceTimer As Timer Public Sub New() ' Set the ServiceBase.ServiceName property. ServiceName = "TestMyService Service" ' Configure the level of control available on the service. CanStop = True CanPauseAndContinue = True CanHandleSessionChangeEvent = True ' Configure the service to log important events to the ' Application event log automatically. AutoLog = True End Sub Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. End Sub Protected Overrides Sub OnStop() ' Add code here to perform any tear-down necessary to stop your service. End Sub Public Shared Sub Main() ' Create an instance of the TestMyService class that will write ' an entry to the Application event log. Pass the object to the ' shared ServiceBase.Run method. ServiceBase.Run(New TestMyService) End Sub End Class
나는 다음과 같은 오류 메시지가있어이있다 mcWinService.TestMyService.Main(), mcWinService.TestMyService.Main()
공용 공유 Sub Main() '에는 동일한 서명이있는 여러 정의가 있습니다.
디자이너에서 생성 한 Public Sub New() '형식'mcWinService.TestMyService '는 InitializeComponent 메서드를 호출해야합니다.
샘플 및 링크를 제공해 주셔서 감사합니다. – Narazana