摘要: 原文地址:http://hi.baidu.com/wth123/blog/item/86a3f50ceeb754e937d1226c.html一、使用用互斥量(System.Threading.Mutex) 同步基元,它只向一个线程授予对共享资源的独占访问权。在程序启动时候,请求一个互斥体,如果能获取对指定互斥的访问权,就职运行一个实例。 代码 bool createNew; using (System.Threading.Mutex mutex =new System.Threading.Mutex(true, Application.ProductName, out createNew). 阅读全文
posted @ 2011-04-22 15:58 Sangplus 阅读(1206) 评论(0) 推荐(0) 编辑