以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  BeforeConnectOuterDataSource 加入关闭系统的代码无效  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=29533)

--  作者:atmetmicoo
--  发布时间:2013/3/8 13:40:00
--  BeforeConnectOuterDataSource 加入关闭系统的代码无效
狐爸,您好,如题:

我希望在BeforeConnectOuterDataSource里面检查网络,如果ping不通服务器就自动关闭系统,不再运行后面的代码,但是好像不是这样的,它提示错误后还会有连接服务器的动作,请问如何能做到我想的这样,谢谢。

try
    If Network.Ping("MYhostIP") Then
    Else
        MessageBox.Show("连接服务器失败,请检查网络或咨询网管.")
        syscmd.project.Exit()
        Return
    End If
Catch ex As Exception
    MessageBox.Show("连接服务器失败,请检查网络或咨询网管.")
    syscmd.project.Exit()
    Return    
End try



--  作者:狐狸爸爸
--  发布时间:2013/3/8 14:17:00
--  

不能在这里关闭系统。用这个事件:

http://www.foxtable.com/help/topics/1615.htm

 

e.Cance = True