0

是否可以从函数返回退出?

这样我就可以使用函数 MyExit 退出 Page_Load 函数

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    MyExit()   'Exit

End Sub

Private Function MyExit() As Exit

    Return Exit 

End Function
4

2 回答 2

2

不,但您可以设置这样的标志:

Protected Sub Page_Load()
    Dim bExit as Boolean = MyExit()
    If bExit then Exit
End Sub

Private Function MyExit() As Boolean
    Dim bOk as Boolean

    '[...] 

    Return bOk
End Function
于 2013-01-18T12:40:59.967 回答
0

这个怎么样?

Private Sub MyExit()

    End

End Sub
于 2013-01-18T14:22:28.230 回答