您的位置:首页 > 编程语言 > C#

C# 单例模式 启动画面

2013-11-04 16:57 155 查看
static class Program

{

/// <summary>

/// 应用程序的主入口点。

/// </summary>

static bool canStart;

static System.Threading.Mutex mutex = new System.Threading.Mutex(false, "Form1", out canStart);

[STAThread]

static void Main()

{

if (canStart)

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new Form1());

}

else

{

MessageBox.Show("程序已启动");

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: