以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  退出项目请教  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79250)

--  作者:hbhb
--  发布时间:2015/12/27 18:40:00
--  退出项目请教
大师:退出项目后,立即继续打开,就显示项目已经打开,还要等一会儿,才能继续打开?什么回事?
--  作者:大红袍
--  发布时间:2015/12/27 18:59:00
--  

你做了只能打开一个的代码?你代码怎么写的?贴出来看看


--  作者:hbhb
--  发布时间:2015/12/27 21:13:00
--  
\'检测本机项目是否重复打开
\'If System.Diagnostics.Process.GetProcessesByName("项目进程名称").Length > 0 Then   \'---根据进程名控制项目重复打开,发布前为foxtable,发布后为项目名称
    \'msgbox("禁止打开多个项目",vbSystemModal)
    \'e.Cancel = True
\'End If
\'


Dim sucess As Boolean = False
static proc = new System.Threading.Mutex(True, "dsdfhdfghf", sucess)
If not sucess Then
    MessageBox.Show("项目已经打开!")
    e.Cancel = True
End If


--  作者:大红袍
--  发布时间:2015/12/27 21:16:00
--  

kill掉,BeforeCloseProject事件

 

system.diagnostics.process.GetProcessesByName("dsdfhdfghf")(0).kill


--  作者:hbhb
--  发布时间:2015/12/27 21:23:00
--  
不行,如果未启动就关闭,显示数组超出了界限?
--  作者:大红袍
--  发布时间:2015/12/27 21:25:00
--  
BeforeCloseProject事件
--  作者:hbhb
--  发布时间:2015/12/27 22:06:00
--  
就是写在这个事件里的呀?
--  作者:大红袍
--  发布时间:2015/12/27 22:14:00
--  

用public变量,关闭项目的时候close掉

 

proc.close


--  作者:hbhb
--  发布时间:2015/12/27 22:35:00
--  
static proc = new System.Threading.Mutex(True, "dsdfhdfghf", sucess)
劳驾把这句代码详细解释一下如何?

--  作者:大红袍
--  发布时间:2015/12/28 9:34:00
--  

百度 http://www.baidu.com/baidu?wd=System.Threading.Mutex&tn=monline_4_dg