Hi all. I've been working on a small program, and I need to get the Process ID by the name. This is what I have:
Dim Processes() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName(ProcessName)
Dim Process As System.Diagnostics.Process = Processes(0)
Dim id = Process.Id
But I always get this error: Index was outside the bounds of the array.
The process I'm using at the moment is running.