日韩精品中文字幕一区二区-日韩精品中文字幕一区-日韩精品中文字幕视频-日韩精品在线一区二区三区-第一页在线-第一福利视频

當前位置:首頁文章首頁 IT學院 IT技術

ASP升級程序的介紹及使用說明

作者:  來源:  發布時間:2011-6-13 15:16:51  點擊:
s.type=1
s1.type=1
s2.type=1

s.loadfromfile(server.mappath(filename))
s.position=size
s1.write(s.read)
s1.position=0
s1.type=2
s1.charset="gb2312"
s1.position=0
a=split(s1.readtext,vbcrlf)
s.position=0

i=0
while(i<ubound(a))
 b=split(a(i),">")
 if b(0)="folder" then
  if not fso.folderexists(path&b(2)) then
   fso.createfolder(path&b(2))
  end if
 elseif b(0)="file" then
  if fso.fileexists(path&b(2)) then
   fso.deletefile(path&b(2))
  end if
  s2.position=0
  s2.write(s.read(b(1)))
  s2.seteos
  s2.savetofile(path&b(2))
 end if
 i=i+1
wend

s.close
s1.close
s2.close
set s=nothing
set s1=nothing
set s2=nothing
set fso=nothing
if err.number<>0 then
 response.write err.description
else
 response.write "安裝成功"
end if
end function

%>


 

<%
'文件名稱:pack.asp
on error resume next
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath("./pack.jpg")) then
 response.Write("pack.jpg已經存在")
 response.End()
end if

dim str,s,s1,s2
set s=server.createobject("ADODB.Stream")
set s1=server.createobject("ADODB.Stream")
set s2=server.createobject("ADODB.Stream")

s.Open
s1.Open
s2.Open

s.Type=1
s1.type=1
s2.Type=2

call WriteFile(server.MapPath("./"))

s2.charset="gb2312"
s2.WriteText(str)
s2.Position=0
s2.type=1
s2.Position=0
bin=s2.Read

s2.Position=0
s2.type=2
s2.writeText("time="&now&vbcrlf)
s2.writeText("size="&s1.size&vbcrlf)
s2.writeText("run="&request.Form("run")&vbcrlf)
s2.seteos
s2.savetofile(server.mappath("./config.txt"))

s1.write(bin)
s1.SetEOS
s1.SaveToFile(server.mappath("./pack.jpg"))

s.close
s1.close
s2.close

set s=nothing
set s1=nothing
set s2=nothing

if err.number<>0 then
 response.write err.description
else
 response.Write("完成")
end if

Function WriteFile(folderspec)
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)

Set fc = f.Files
For Each f1 in fc
 if f1.name<>"pack.asp" then
  str=str&"file>"&f1.size&">"&replace(folderspec&"\"&f1.name,server.MapPath("./"),"")&vbcrlf
  s.LoadFromFile(folderspec&"\"&f1.name)
  img=s.Read()
  s1.Write(img)
 end if
Next

Set fc = f.SubFolders
For Each f1 in fc
  str=str&"folder>0>"&replace(folderspec&"\"&f1.name,server.MapPath("./"),"")&vbcrlf
  WriteFile(folderspec&"\"&f1.name)
Next

set fso=nothing
End Function
%>



ASP升級程序使用說明

 

本程序分兩部分:
1、ASP文件打包程序pack.asp
 把這個程序和要打包的程序放到一個目錄下,然后運行pack.asp,得到pack.jpg和config.txt
2、ASP在線更新、下載、安裝程序updata.asp
 這個程序可以用來檢查是否存在可用更新,和updata.asp同一目錄要存在上面得到的config.txt,因為config里面有當前程序的安裝日期,用來和網上的程序比較用的。
 使用前,先修改updata.asp里的url變量的值,使其等于你存放升級程序的URL,運行updata.asp就可查看是否存在可用更新,如果存在就可用按著向導一步一步下載并安裝更新了。

遠程地址url下面存放用pack.asp得到的pack.jpg和config.txt

本程序既可以用來做升級程序,當然如果原來安裝目錄下是空的,那就是一個完整的安裝程序,^_^,也可以把updata.asp放到后臺的首頁里,這樣每次登陸都可以自動檢查是否有可用更新

注意:本地或者遠程沒有config.txt會導致程序不可用,以后會考慮加入這個容錯機制。

相關軟件

相關文章

文章評論

欄目導航

本類熱門

本類推薦

本站熱門

本站推薦

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
主站蜘蛛池模板: 天下第一楼演员表全部| 潜伏电视剧全集30集免费观看| 李赫洙| 鬼谷子电视剧| 复仇女王 电视剧| 安志杰电影全集大全| 卡卡龙| 复仇女王 电视剧| 伸舌头接吻脱裤子| 消防给水及消火栓技术规范gb50974-2014| 明宰铉身高| 一夜风流| 韩国电影《甜性涩爱》| 瑞斯·伊凡斯| 大学英语综合教程3| 电影英雄| 上门女婿电影完整版免费| 上门女婿电视剧演员| 石灰和碱的6种配方| 林丹出轨视频| 女生被艹| 北京卫视今天节目预告| 被囚禁的女孩大结局| 大森南朋| 布莱克·莱弗利身高体重| 外国小哥街头索吻狂魔| 媚狐传| 汽水音乐app官网| 南贤俊| 新目标大学英语综合教程2答案| 女生操女生| 松岛菜菜子| 超薄打底广场舞视频| 拔萝卜视频免费播放| 金枝玉叶电视剧免费观看| 上门女婿电视剧演员| 误杀2演员名单| www.douyin.com| 零炮楼电视剧演员表| 李泽宇| 釜山电影节|