最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP升级程序
时间:2022-07-02 23:32:30 编辑:袖梨 来源:一聚教程网
'文件名:updata.asp
'远程地址
const url="http://loc**alhost*/test/"
action=request("action")
if action="updata" then
download(url&"config.txt")
download(url&"pack.jpg")
response.Write("下载成功")
elseif action="install" then
str=openfile("config.txt")
if str="" then
response.write "缺少本地配置文件config.txt"
else
size=RegExpTest("size",str)
call install("pack.jpg",size)
end if
else
str=getpage(url&"config.txt")
if str="" then
response.write "不存在可用更新或者本地配置不正确"
response.end
end if
str1=openfile("config.txt")
if str1="" then
response.write "缺少本地配置文件config.txt无法获知本地程序的安装时间"
response.end
end if
updatatime=RegExpTest("time",str)
updatatime1=RegExpTest("time",str1)
if DateDiff("d",updatatime1,updatatime)>0 then
response.Write("存在可用更新,更新日期:"&updatatime&"")
else
response.write "您的程序是最新的了"
end if
end if
function openfile(filename)
set fso=server.CreateObject("scripting.filesystemobject")
if fso.fileexists(server.MapPath(filename)) then
set f1=fso.opentextfile(server.mappath(filename),1,true)
openfile=f1.readall
f1.close
else
openfile=""
end if
set fso=nothing
end function
function getpage(url)
set xmlhttp=server.createobject("Microsoft.XMLHTTP")
xmlhttp.open "get",url,false
xmlhttp.send
if xmlhttp.status200 then
'远程地址
const url="http://loc**alhost*/test/"
action=request("action")
if action="updata" then
download(url&"config.txt")
download(url&"pack.jpg")
response.Write("下载成功")
elseif action="install" then
str=openfile("config.txt")
if str="" then
response.write "缺少本地配置文件config.txt"
else
size=RegExpTest("size",str)
call install("pack.jpg",size)
end if
else
str=getpage(url&"config.txt")
if str="" then
response.write "不存在可用更新或者本地配置不正确"
response.end
end if
str1=openfile("config.txt")
if str1="" then
response.write "缺少本地配置文件config.txt无法获知本地程序的安装时间"
response.end
end if
updatatime=RegExpTest("time",str)
updatatime1=RegExpTest("time",str1)
if DateDiff("d",updatatime1,updatatime)>0 then
response.Write("存在可用更新,更新日期:"&updatatime&"")
else
response.write "您的程序是最新的了"
end if
end if
function openfile(filename)
set fso=server.CreateObject("scripting.filesystemobject")
if fso.fileexists(server.MapPath(filename)) then
set f1=fso.opentextfile(server.mappath(filename),1,true)
openfile=f1.readall
f1.close
else
openfile=""
end if
set fso=nothing
end function
function getpage(url)
set xmlhttp=server.createobject("Microsoft.XMLHTTP")
xmlhttp.open "get",url,false
xmlhttp.send
if xmlhttp.status200 then
相关文章
- 原神头像框怎么获得 头像框获取教程攻略 09-17
- 无主之地4卡卡地亚焚毁区信标聚合器在哪 卡卡地亚焚毁区信标聚合器收集攻略 09-17
- 地狱即我们道具怎么装备 道具装备与快捷键使用教学 09-17
- 地狱即我们最低要什么配置 最低配置要求一览 09-17
- 鸣潮2.6角色哪些比较厉害-2.6角色强度排行介绍 09-17
- 无主之地4隐没旷野信标聚合器在哪 隐没旷野信标聚合器收集攻略 09-17