The automatic upgrade of the website mainly involves downloading certain files from a server to this server, and then updating the downloaded files.
For example, there is server A, server B and client C.
As a product developed by COM company, the DIV website system is installed on server B, and its update settings and update files are on server A. When client C accesses the website of server B, B downloads the update file from A and then performs the update operation.
Although the fourth step is the most important and the core of the logic, what files to download and how to download them are also tied to us.
The ASP.NET2.0 introduced here is VB.NET. VB.NET introduces a new namespace - My .
My space contains many contents, let’s talk about one here. Many people may have noticed that it is the My.Computer.Network.DownloadFile method.
Partial Class _DefaultClass _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load()Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim pFile As String = " http://xpasp.e0351.cn/aa.html "
Dim sFile As String = "cc.html"
My.Computer.Network.DownloadFile(pFile, System.Web.HttpContext.Current.Server.MapPath(sFile))
End Sub
End Class
is very simple, haha. When user C opens the page, the program automatically downloads the file.
Comparisons will not be introduced in other parts because the logic is more complicated. For example, I want to implement update priority (must be updated, user selected, etc.), as well as version control, etc.
by Xie Ping
July 10, 2006