This app is set to check for a particular process every 3 minutes. Seems there is a memory leak somewhere becuse it keeps using more memory. I would appreciate if someone would check to see how this can be fixed. This is running under WinXP Pro SP2, .net Framework 3.0, The code is below.
Code:
Imports System.Diagnostics
Imports System.IO
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e _
As System.EventArgs) Handles Timer1.Tick
Execute()
End Sub
Private Sub Execute()
Dim PrcsEncode As Process()
Dim TodayDateTime As Date = Now()
PrcsEncode = Process.GetProcessesByName("Encode")
If PrcsEncode.Length = 1 Then
PrcsEncode = Nothing
Exit Sub
End If
If PrcsEncode.Length = 0 Then
PrcsEncode = Nothing
File.AppendAllText("C:\documents and settings\user\ _
desktop\ProcessesLog.txt", TodayDateTime & " - The _
application was not running." & vbCrLf & vbCrLf)
Shell("C:\DVR\DVR.exe", , True, 7000)
End If
End Sub
End Class
Comment