WinForm 只允许打开一个程序

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Dachie
{
static class Program
{
///<summary>
/// The main entry point for the application.
///</summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool createNew;

System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew);
if (createNew)
Application.Run(new login());
}
}
}

posted on 2011-11-28 17:40  缘从心开始  阅读(201)  评论(0编辑  收藏  举报

导航

文章作者:(Super)
文章出处:http://www.cnblogs.com/superai
欢迎转载,转载时请注明出处。谢谢合作。