1、打开Program.cs
2、引用using System.Diagnostics
3、在main()方法中进行如下判断
Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length <= 1 //成立的话说明没有打开过此程序,没有此进程,反而反之
1、打开Program.cs
2、引用using System.Diagnostics
3、在main()方法中进行如下判断
Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length <= 1 //成立的话说明没有打开过此程序,没有此进程,反而反之