以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 如何控制程序只运行一次呢  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=64135)

--  作者:chnjng
--  发布时间:2015/2/5 17:17:00
--  [求助] 如何控制程序只运行一次呢

就是发布后的程序,

如果用户已经运行了,

这时,用户又双击快捷方式又来打开一次,

怎么样控制不要运行多个实例?

[此贴子已经被作者于2015-2-5 17:17:41编辑过]

--  作者:有点甜
--  发布时间:2015/2/5 17:19:00
--  

\'BeforeOpenProject事件:

 

Dim sucess As Boolean = False
static mu As new System.Threading.Mutex(True, "dsdfhdfghf", sucess)
If not sucess Then
    MessageBox.Show("只能打开一次!")
    e.Cancel = True
End If