Silverlight浏览器关闭事件

发布于 2024-07-18 08:17:50 字数 171 浏览 2 评论 0原文

当用户关闭托管 Silverlight 2 应用程序的浏览器时,我需要调用一个 Web 服务来注销用户。 我知道 Application_Exit 事件,但是当我在该事件中调用我的服务时,什么也没有发生。 我认为到那时与我的服务的连接已经关闭。

我还应该使用其他事件吗?

请帮忙。

When the user closes the browser that hosts my Silverlight 2 Application I need to call a web service that would log the user out. I am aware of the Application_Exit event, however when I call my service in that event nothing happens. I presume that the connection to my service is already closed by then.

Is there another event that I should use?

Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿看小鸭子会跑 2024-07-25 08:17:50

不要这样做。 Silverlight 不支持在应用程序退出时调用服务。 您需要服务自行清理,可能需要应用程序每隔几分钟/几小时通知服务以延迟清理。
指向 Silverlight 论坛和相同问题的链接

Don't do it. Calling a service at application exit is not supported by Silverlight. You need the service to clean itself up, possibly with the application telling the service every few minutes/hours as appropriate tto delay the cleanup.
Link to Silverlight Forums and the same question

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文