● Description: ASP online upgrade class
● Version: 1.0.0
● Author: Xiao Yuehen (xiaoyuehen)
● MSN: xiaoyuehen (at) msn.com
● Please (at) @ replace
● Copyright: Since sharing, there is no copyright. But it must be limited to network communication, and must not be used in traditional media!
● If you can keep these description information, I am more thanking!
● If you have better code optimization, relevant improvements, please remember tell me, thank you very much!
● Idea:
1. Query version list => 2. Comparison Version Difference => 3. Get a list of high version updates, if there is no higher version, jump to step 5 => 4. Update => Return to Step 3
5. Exit Update
● Other instructions: incremental upgrade.
● Question out: A total of more than 7 hours, a bit hastily, the code is not fine enough. When testing, update two versions, a total of 4 files, spending nearly 1 second.
I haven't done similar things before, so I can't talk about what algorithm. If I have done, I have to mention more opinions, thank you!
● This code is intended to communicate with each other.
● Before you begin, read the following description.
● Server requirements:
1. Site Manager can access version and related upgrade information via URL addresses.
2. Version information file, such as Version.asp
3. Each version directory must be under the directory specified by Urlupdate (see below): urlupdate is http: // localhost / __ jxc / update /,
Version is 1.0.8 The upgrade file of this version must be in http: // localhost / __ jxc / update / 108 /.
4. The information returned by version information is a list, and each line represents a version information (not a blank line), the high version is on. As follows:
1.1.0
1.0.8
1.0.0
5. Some version of the file update information format is removed. Number FileType (see below), in Urlupdate, such as: http://localhost/__jxc/Update/110.asp, its content format is as follows:
3.htm | TEST / TEST / 3.asp
4.htm | TEST / TEST / 4.ASP
5.htm | TEST / 5.ASP
6.htm | TEST / 6.ASP
Separate source files and destination files. The source file will be read from the corresponding version directory, as the address corresponding to the above 3.HTM should be
http://localhost/__jxc/update/110/3.htm
If updatelocalpath = "/", the update purpose of TEST / TEST / 3.ASP is / Test/Test/3.asp, and the program will automatically create a directory in the update process.
And override the target file
● Client requirements:
IIS 5.0 or more
FSO support (for generating files)
Adodb.Stream support (for encoding conversion)
Microsoft.xmlhttp support (for remote acquisition information)
● Properties:
Info gets the last information during the upgrade process
● Parameter description:
URLVERSION ● Must be ● Version Information Complete URL, starting with http: //
URLUPDATE ● Must be ● Upgrade URL, starting with http: //
UpdateLocalPath ● Must update the directory in the locally, to start, / end. Taking / starting to update for the current site. Prevention from writing to other directories. ● Default ● /
URLHISTORY ● Must ● The generated software history file file name
Localversion ● Must ● Current version information ● Default ● 1.0.0
FileType ● Must be ● Version information compact name ● Default value ● .asp
● Method Description:
Doupdate upgrade
After the relevant parameters are set, you can start this method.
● Other instructions: The version number must be a number of 0-9 and. Composition, and the first bit cannot be less than 1, each version number must be consistent. Such as 1.0.0 and 1.2.2 or 1.2.04 and 1.2.78
● Example:
<%
Dim objupdate
Set objupdate = new CLS_oupdate
With objupdate
.Urversion = "http://localhost/__jxc/Update/Version.asp"
.Urlupdate = "http:// localhost / __ jxc / update /"
.Updatelocalpath = "/"
.Localversion = "1.0.0"
.doupidDate
Response.write (.info)
End with
Set objUpdate = Nothing
%>
Class file content