.NET客户端应用程序:.NET应用程序更新组件(3)

作者:袖梨 2022-07-02
作者:Jamie Cool
Microsoft Corporation
3/4/02
翻译:李嘉
北京.东方瑞道
2004-6-3
(接上篇)
Checking for Updates
为更新做检查
The first thing an application needs to be able to do in order to update itself is figure out when a new update is available. In order to do this an application needs to know three things 1) where to check for updates, 2) when to check for updates and 3) how to check for updates. The application update component uses HTTP for all network communication. This allows it to update applications over the intranet or extranet. Thus the 'where’ to check for updates is simply a URL to a well known Web server.

为了更新自身,应用程序首先需要做的就是弄清楚可使用的更新放在什么地方。为做到这一点,应用程序需要知道三件事情:1)到什么地方为更新做检查;2)什么时候进行更新检查;3)如何进行更新检查。应用程序更新组件使用HTTP进行所有的网络通讯。这就允许通过企业网或外网来更新应用程序。这样的话进行更新检查所需要的地址就成了已知的Web服务器的一个URL地址。

To address the 'when’ to check for updates, the .NET Application Updater component creates a thread on component creation which is responsible for checking for updates. This thread will sleep for most of the time, but will wake up at the configured interval to perform an update check. How often the application checks for new updates is dependent on the individual application, but common values range from one hour to one day between update checks. This polling based approach is not appropriate for all applications, for example Microsoft Money only checks for updates when the user tells them to. In this case, the update poller thread can be disabled and update checks performed on-demand by calling the CheckForUpdate() method on the updater component.

相关文章

精彩推荐