public class ProcessMonitor : IDisposable
Public Class ProcessMonitor
Implements IDisposable
Dim instance As ProcessMonitor
public ref class ProcessMonitor : IDisposable
type ProcessMonitor =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Public Class Form1 : Inherits Form
Dim WithEvents procMon As New ProcessMonitor With {.Interval = 100}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) _
Handles Me.Load
Me.procMon.Start()
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) _
Handles Me.FormClosing
Me.procMon.Dispose()
End Sub
Private Sub ProcessMonitor_ProcessStarted(ByVal sender As Object, ByVal e As ProcessMonitor.ProcessMonitorEventArgs) _
Handles procMon.ProcessStarted
Dim p As Process = Process.GetProcessById(e.ProcessId)
Console.WriteLine(String.Format("Process started | Name: {0}", e.ProcessName))
Console.WriteLine(String.Format("Process started | PID : {0}", e.ProcessId))
Console.WriteLine(String.Format("Process started | Path: {0}", p.MainModule.FileName))
End Sub
Private Sub ProcessMonitor_ProcessStopped(ByVal sender As Object, ByVal e As ProcessMonitor.ProcessMonitorEventArgs) _
Handles procMon.ProcessStopped
Console.WriteLine(String.Format("Process started | Name: {0}", e.ProcessName))
Console.WriteLine(String.Format("Process started | PID : {0}", e.ProcessId))
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ProcessMonitor | Initializes a new instance of the ProcessMonitor class. |
Interval | Gets or sets the monitoring interval. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
Start | Starts monitoring. |
Stop | Stops monitoring. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
ProcessStarted | Occurs when a process starts. |
ProcessStopped | Occurs when a process stops. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |