What is the correct way to create a single-instance WPF application?

前端 未结 30 3870
耶瑟儿~
耶瑟儿~ 2020-11-21 05:14

Using C# and WPF under .NET (rather than Windows Forms or console), what is the correct way to create an application that can only be run as a single instance?

I kno

30条回答
  •  不要未来只要你来
    2020-11-21 05:47

    You should never use a named mutex to implement a single-instance application (or at least not for production code). Malicious code can easily DoS (Denial of Service) your ass...

提交回复
热议问题