1

在asp.net中,有app_offline.htm可以让你优雅地关闭网站。我想在客户端实现类似的功能。有一个标志设置为维护模式,如果标志打开:

  • 当用户启动客户端时,会提示用户“系统正在维护,30分钟后重试”。
  • 任何新的更新/删除/添加操作,都会提示类似消息。
  • 将处理正在进行的请求。

如何实施?

4

2 回答 2

1

鉴于应用程序架构的差异,这并不是一种适用于所有人的“一刀切”类型的解决方案。

用于 Web 应用程序的 app_offline.html 确实是一种“大锤”方法。该应用程序已关闭,是的,它很优雅,但它是 100% 硬停止。

在您的应用程序中执行此操作的一种原始方式可能是定期为“在线”或类似内容进行服务调用。如果它返回 false,则强制退出当前表单并显示启动页面。

但这实际上将取决于架构。

于 2013-03-26T16:09:12.807 回答
0

You can put a condition when starting the client, but you if you want the same behavior like app_offline.htm, you may also want to put under maintenance an already opened client.

In this case, you can install a MessageFilter in order to intercept any event across the whole Winforms app.

于 2013-03-27T09:40:13.070 回答