惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - Heclei

WebDeploy 同步IIS6 bindingRedirect 相当奇怪的设置 - Heclei - 博客园 C# 使用WM_NCLBUTTONDOWN消息实现任意位置移动窗体 发布开源程序:数据库结构比较 VS2005 WEB F5调试自动退出调试状态 JS整理,getCookie, getElementsByClassName , 添加删除事件 (转)VC++ 2005 用程式建立 Paradox ( *.db ) 资料库档桉 - Heclei C# 判断操作系统类型 Service Broker实现发布-订阅(Publish-Subscribe)框架(3) Service Broker实现发布-订阅(Publish-Subscribe)框架(2) Service Broker实现发布-订阅(Publish-Subscribe)框架(1) .net sqlserver 关于连接池没事释放的注意项 mysql ERROR 1045 JS实现局部打印和预览 perforce,P4,权限设置 Visual Studio 2005 sp1 新愁加就恨 将一个数据库的登录账户转移到另一个账户中(Trans logins from one database to another ) Find the need for WinFx, understanding for very very beginners 使用vsto制作的outlook插件,安装加载失败
(转)C# 单实例 - Heclei - 博客园
Heclei · 2009-03-13 · via 博客园 - Heclei

 static private bool IsOneInstance()
        {
#if !DEBUG
            bool one;
            mutex = new System.Threading.Mutex(true, "VIPSHOP", out one);
            return one;
#else
            return true;
#endif
        }

            if (IsOneInstance())
            {
                Application.Run(new LoginFrm());
            }
            else
            {
                MessageBox.Show("只允许运行一个实例", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

在Application.ApplicationExit += new EventHandler(Application_ApplicationExit);

释放mutex

if (mutex != null)
            {
                mutex.ReleaseMutex();
                mutex.Close();
            }