以下是引用lxl在2011-4-21 20:07:00的发言:
写文件有风险。非法关闭,或者任务管理器里面关闭,文件没删除的话,就再打不开项目了
可以用下面代码实现
全局代码:
Public mu As System.Threading.Mutex
BeforeOpenProject事件:
Dim sucess As Boolean = False
mu = new System.Threading.Mutex(True, "dsdfhdfghf", sucess)
If not sucess Then
MessageBox.Show("只能打开一次!")
e.Cancel = True
End If
[此贴子已经被作者于2011-4-21 20:07:40编辑过]
收藏,谢谢!