使用Mono和c#的单实例应用程序

时间:2013-10-31 10:02:38

标签: c# macos mono

我想在启动时创建一个关闭此应用程序的每个其他实例的应用程序。对于Windows,我这样做:

            var pr = System.Diagnostics.Process.GetProcessesByName(
                System.IO.Path.GetFileNameWithoutExtension(typeof(Program).Assembly.Location));
            var Id = System.Diagnostics.Process.GetCurrentProcess().Id;
            foreach (var p in pr.Where(x => x.Id != Id))
            {
                p.Kill(); 
            }

如何使用mono for OSX?

0 个答案:

没有答案
相关问题