You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
473 B

using System.Windows.Forms;
namespace CK.SCP.Utils
{
public class ProgramHelper
{
public static bool HasExist()
{
bool notExist;
System.Threading.Mutex run = new System.Threading.Mutex(true, Application.ProductName, out notExist); //核心代码
if (notExist) return false;
MessageBox.Show(Application.ProductName + "已运行,无法重复启动。");
return true;
}
}
}