问题
I've seen all the answers for the standard framework
What is the correct way to create a single instance application?
Prevent multiple instances of a given app in .NET?
What is the best way to make a single instance application in .net?
How do I check whether another process with the same name exists using the compact framework?
The 3 parameter constructor is not supported by the CF
Process GetProcessByName is not supported by the CF
回答1:
OpenNETCF gives you class OpenNETCF.Threading.NamedMutex that let's you create system-wide named mutex.
http://www.opennetcf.com/library/sdf/html/40db385b-e21b-7c38-6f22-7a7954a30aa2.htm
回答2:
Perhaps the steps described on blog: http://www.nesser.org/blog/archives/56 could help (also check the comments).
LP, Dejan
来源:https://stackoverflow.com/questions/1153051/what-is-the-best-way-to-make-a-single-instance-application-in-compact-framework