当vb.net 2008应用程序关闭或崩溃时,自动注销用户

时间:2014-02-28 05:24:33

标签: vb.net

我正在做一个vb.net应用程序,其中用户需要登录系统。如果系统崩溃或停止如何更改其登录状态以退出?我将如何在系统中自动注销用户?提前感谢。您的回答对我有很大的帮助。

1 个答案:

答案 0 :(得分:0)

除非您在遇到错误时捕获错误并执行某些操作或重新路由代码执行方向,否则无法执行此操作。你可以这样做......

Try
'Whatever regular code
Catch ex as Exception
'Upon encountering error do the logout code here
Finally
'This part executes whether your app encounters error or not, so if you just want to logout when your app meets the error, you can leave this blank.
End Try

如果错误是与数据库的连接,则无效。