[Mono-list] Process.GetProcess()

mickeyf mickey at thesweetoasis.com
Thu Jan 24 15:09:44 UTC 2013


Well, yes, that post is rather long in the tooth. Never the less...

Using mono 2.10.8.1 on a Beaglebone (ARM):

Process[] Procs = Process.GetProcesses();

	foreach (Process p in Procs)
	{
		Console.WriteLine(p.ProcessName + " is running...");
	}

The program running this shows up, lots of other show up, but the one I care
about is not there. However, 

SERVICE='Myapp.exe'

while [ 1 ] ; do
	if ps ax | grep -v grep | grep $SERVICE > /dev/null
		then
			echo "$SERVICE running"
		else
			echo "$SERVICE not running"
	fi
	sleep 1
done

Does find it reliably. I've tried GetProcessByName with the same results. I
have just tested this on a PC with the same results.

Usually this sort of thing means I've missed something that should be simple
and obvious, but if so, I'm still missing it.





--
View this message in context: http://mono.1490590.n4.nabble.com/Process-GetProcess-tp4658257p4658270.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list