这个问题可能有点模糊,但我们来详细讨论一下。
我正在防止我的wpf应用程序出现多个实例,如下所示:
我正在防止我的wpf应用程序出现多个实例,如下所示:
Process proc = Process.GetCurrentProcess();
if (Process.GetProcessesByName(proc.ProcessName).Length > 1)
{
Application.Current.Shutdown();
return;
}
if (e.Args != null && e.Args.Count() > 0)
{
this.Properties["Magnet"] = e.Args;
}
已经运行的应用程序是否可以传递命令行参数?