VB.Net 2003 - Detect Process Running?
I'm working on a simple app to detect a process when running. Right now everything is running ok if the process is running, but if the process is not running my app will crash. I'm not sure how to validate if the process is not running to do nothing. Any suggestions? Thanks!
Private oPerf As New PerformanceCounter
oPerf.CategoryName = "Process"
oPerf.CounterName = "% Processor Time"
oPerf.InstanceName = "PROCESSNAME"
Label1.Text = oPerf.NextValue.ToString()
If Label1.Text > 0 ........