Помогите с проблемой. Служба инсталируется, запускается, но не срабатывает событие, когда запускается процесс допустим Тотал Коммандера. Ошибок не пишет. Не пойму где лажа.
| Код | Imports System Imports System.ServiceProcess Imports System.Diagnostics Imports System.Timers Public Class Service1 Dim aa() As Process Protected Overrides Sub OnStart(ByVal args() As String) Timer1.Enabled = True Timer1.Interval = 5000 End Sub Protected Overrides Sub OnStop() Timer1.Enabled = False Me.Dispose() End Sub Private Sub Timer_Tick(ByVal source As Object, ByVal e As System.EventArgs) Handles Timer1.Tick aa = Process.GetProcessesByName("totalcmd") If aa.Length > 0 Then Timer1.Enabled = False MsgBox(aa.Length) OnStop() End If End Sub End Class
|
|