Posted on
2005-02-03 17:08Hover
阅读(3342)
评论(4)
收藏举报
staticvoid Main() { // get the name of our process string proc=Process.GetCurrentProcess().ProcessName; // get the list of all processes by that name Process[] processes=Process.GetProcessesByName(proc); // if there is more than one process if (processes.Length >1) { MessageBox.Show("Application is already running"); return; }else Application.Run(new Form1()); }