It is necessary to ensure that the software runs only once, and the method is also very simple. You only need to judge whether the current process name exists in the process. For WPF software, it is determined in App. XAML. cs. You can override the OnStartup method. [Csharp] public partial class App: application {// <summary> /// open only one process /// </summary> /// <param name = "e"> </param> protected override void onStartup (StartupEventArgs e) {Process currentProcess = Process. getCurrentProcess (); foreach (Process item in Process. getProcessesByName (currentProcess. processName) {if (item. id! = CurrentProcess. id & (item. startTime-currentProcess. startTime ). totalMilliseconds <= 0) {item. kill (); item. waitForExit (); break;} base. onStartup (e) ;}} public partial class App: application {// <summary> /// open only one process /// </summary> /// <param name = "e"> </param> protected override void onStartup (StartupEventArgs e) {Process currentProcess = Process. getCurrentProcess (); foreach (Process ite M in Process. GetProcessesByName (currentProcess. ProcessName) {if (item. Id! = CurrentProcess. id & (item. startTime-currentProcess. startTime ). totalMilliseconds <= 0) {item. kill (); item. waitForExit (); break;} base. onStartup (e) ;}} for Winform, it is determined directly in the construction of the main form. [Csharp] public partial class Form1: Form {public Form1 () {InitializeComponent (); StartUp ();} private void StartUp () {Process currentProcess = Process. getCurrentProcess (); foreach (Process item in Process. getProcessesByName (currentProcess. processName) {if (item. id! = CurrentProcess. id & (item. startTime-currentProcess. startTime ). totalMilliseconds <= 0) {item. kill (); item. waitForExit (); break ;}}} public partial class Form1: Form {public Form1 () {InitializeComponent (); StartUp ();} private void StartUp () {Process currentProcess = Process. getCurrentProcess (); foreach (Process item in Process. getProcessesByName (currentProcess. processName) {if (item. Id! = CurrentProcess. id & (item. startTime-currentProcess. startTime ). totalMilliseconds <= 0) {item. kill (); item. waitForExit (); break ;}}} simple code to complete this function. Append part: If you want to do more strictly, you can determine the path of the process name: [csharp] www.2cto. comProcess [] sameProcess = Process. getProcessesByName (Path. getFileNameWithoutExtension (AppDomain. currentDomain. baseDirectory + currentProcess. processName); if (sameProcess! = Null & sameProcess. Length> 0) {// here it indicates a duplicate process}