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());
}
}
}
文章作者:
蔚洋(Super)
文章出处:
http://www.cnblogs.com/SUPERAI
欢迎转载,转载时请注明出处。谢谢合作。