簡單的方法,Program.cs 加上判斷process
using System.Diagnostics;
string ProcessName = Process.GetCurrentProcess().ProcessName;
Process[] p = Process.GetProcessesByName(ProcessName);
if (p.Length > 1)
{
// Add Code
MessageBox.Show("重複執行!");
return;
}
沒有留言:
張貼留言