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



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

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

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

如果错误是与数据库的连接,则这不起作用。

最新更新