There are a couple of things you can do.
1) The easiet way to do it is to use the System.Diagnostics namespace.
You can call a static method to get an array of Process objects given
a name. If the list comes back with more than zero elements, then the
application is running. Here is the sample:
System.Diagnostics.Process[] procs =
System.Diagnostics.Process.GetProcessesByName("MyAppName");
Note that the application name does not include the exe extention.
2) When the application comes up bind to a port on the local machine.
If it is not able to bind to a port, that means that it is already up.
At that point the application should exit. The assumption you have
hard coded a port that is not well known.
3) If possible you can take advantage of COM+. COM+ can manage object
counts. Have a look at it. I will not say anymore here because I think
the first option will work for you.
sayed