用户单击窗口标题栏上的关闭按钮时注销应用程序。 [英] logging out the application when user clicks on close button on the titlebar of window.

查看:81
本文介绍了用户单击窗口标题栏上的关闭按钮时注销应用程序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的查询是:



我使用用户名登录了应用程序密码和错误我关闭了应用程序而不是登出。

当我再次登录时显示



用户目前已登录。



如何在关闭应用程序时让用户退出。



这是在windows应用程序中。



请帮助我,



问候,

Nagaraju.N

Hi,

I have query that is:

I logged into the application with username and password and by mistaken i have closed the application instead of doing logging out.
when i again logging in it showing that

"User currently logged in".

how can i make the users logged out when they close the application.

This is in windows application.

Please help me,

Regards,
Nagaraju.N

推荐答案

处理主窗体 FormClosing事件 [ ^ ]并自动退出。



你可能值得暂停登录,因此它们仅适用于af inite期间,或发出会话ID,以便您可以判断会话何时达到异常终止并且登录shoudl已失效。
Handle the main form FormClosing event[^] and auto log out there.

It may be worth your putting a timeout on logins, so they are only valid for a finite period, or issuing them with a session ID so that you can tell when a session reached an abnormal termination and the login shoudl have been invalidated.


如果Web应用程序

使用会话。在全局文件[Application_End]上将其设置为null。如果session为null,请确保将它们重定向到loggin页面。
If web application
Use sessions. Set it to null on Global file [Application_End]. Make sure that they are redirected to loggin page if session is null.


当您使用tabbed-browser时会发生这种情况。在选项卡式浏览器中,但默认情况下会话共享,关闭一个选项卡不会清除会话。它更多的是与应用程序设置相关的浏览器设置。
This would have happened when you had used tabbed-browser. In tabbed browser, but default the session is shared across and closing one tab does not clear the session. It is more of the browser setting related than application setting.


这篇关于用户单击窗口标题栏上的关闭按钮时注销应用程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆