伦理片hd-伦理片 在线播放-伦理片 在线-伦理免费在线观看-综合图片区-综合婷婷

訂閱本欄目 RSS您所在的位置: 深山工作室 > ASP > 正文

asp在線把整站打包成為.mdb形式文件

深山行者個人網(wǎng)站 2009/8/17 9:14:52 深山行者 字體: 瀏覽 4884

<%
Function IsInteger(Para)
 IsInteger=False
 If Not (IsNull(Para) Or Trim(Para)="" Or Not IsNumeric(Para)) Then
  IsInteger=True
 End If
End Function

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>asp在線把整站打包成為.mdb形式文件</title>
<style type="text/css">
<!--
body{font-family: "宋體","Times New Roman", Times, serif; font-size:12px; text-align:center;}
td,select{font-size:12px;}
.table{border-left:1px #999999 solid;}
.trtrb{border-top:1px #999999 solid;border-right:1px #999999 solid; border-bottom:1px #999999 solid;}
.trtr{border-top:1px #999999 solid;border-right:1px #999999 solid;}
.tx{font-family: "宋體";font-size:12px;border:1px solid;border-color:black black #000000;color: #0000FF;}
.button{border:1px #666666 solid; background-color:#FFFFFF; height:18px;}
-->
</style>
</head>
<body leftmargin="0">
<%
dim act,thePath
act=lcase(trim(request("action")))
if act="combine" then
   '用ASP將文件分割器分割的文件合并
   dim fname,f,newname
   newname=request("newname")
   set f=request("f")
   for i=1 to f.count
 if f(i)<>"" then
  fname=fname&"|"&f(i)
 end if
   next
   if newname="" then
 call back("新文件名不能為空!")
   end if
   if fname="" then
 call back("需合并文件名不能全為空!")
   end if
   call combine(fname,newname)
elseif act="addtomdb" or act="releasefrommdb" then
 thePath = Request("thePath")
 Script_TimeOut = trim(request("timeout"))
 if IsInteger(Script_TimeOut) then
  Script_TimeOut = round(Script_TimeOut*60,0)
 else
  Script_TimeOut = 3600
 end if
 Server.ScriptTimeOut = Script_TimeOut
 if act="addtomdb" then
  addToMdb(thePath)
  response.write "<script language=javascript>alert('操作完成!');window.close();</script>"
 elseif act="releasefrommdb" then
  unPack(thePath)
  response.write "<script language=javascript>alert('操作完成!');window.close();</script>"
 end if
end if
%>


<table width="542" border="0" cellspacing="0" cellpadding="0" align="center" class="table">
    <tr bgcolor="#CCCCCC">
      <td class="trtr" height="22" align="center" valign="middle" bgcolor="#CCCCCC"><B>ASP文件打包/解包器 v1.0 by 秋憶</B></td>
    </tr>
 <tr><td>
<table width="542" border="0" cellspacing="0" cellpadding="0" align="center">


<form method=post target=_blank action="<%=selfname%>">
  <tr height="30">
    <td class="trtr">&nbsp;文件夾打包:</td>
    <td class="trtr">&nbsp;
 <input type="text" name="thePath" value="<%=Server.MapPath(".")%>" class="tx" style="width:300px">
 <input type="hidden" value="addToMdb" name="action">
 <select name="theMethod">
 <option value="fso">FSO</option>
 <option value="app">無FSO</option>
 </select>
 </td>
  </tr>
  <tr>
    <td class="trtr" colspan="2" height="25" align="center">
 腳本超時:<input type="text" name="timeout" value="60" class="tx" style="width:40px" />分鐘  
 <input type="submit" value="開始打包" class="button">
 </td>
  </tr>
  <tr>
    <td class="trtr" colspan="2" height="30">&nbsp;注:打包生成Qiuyi.mdb文件,位于當(dāng)前頁面目錄<%=Server.MapPath(".")%>下。</td>
  </tr>
  <tr>
    <td class="trtr" colspan="2" height="40">&nbsp;</td>
  </tr>
  </form>
 
 
</table>
</td></tr>
<tr><td>
<table width="542" border="0" cellspacing="0" cellpadding="0" align="center">
<form method=post target=_blank action="<%=selfname%>">
  <tr>
    <td class="trtr" nowrap="nowrap" height="30">&nbsp;文件夾解包(需FSO支持):</td>
    <td class="trtr" nowrap="nowrap">&nbsp;
 <input type="text" name="thePath" value="<%=Server.MapPath(".")%>\Qiuyi.mdb" class="tx" style="width:300px">
 <input type="hidden" value="releaseFromMdb" name="action">
 </td>
  </tr>
  <tr>
    <td class="trtr" colspan="2" height="25" align="center">
 腳本超時:<input type="text" name="timeout" value="60" class="tx" style="width:40px" />分鐘  
 <input type="submit" value="開始解包" class="button">
 </td>
  </tr>
  <tr>
    <td class="trtrb" colspan="2" height="30">&nbsp;注:解開的所有文件都位于當(dāng)前頁面目錄<%=Server.MapPath(".")%>下。也可以親自使用本系統(tǒng)附帶的undo.vbs文件解開壓縮包。</td>
  </tr>
</form>
</table>
</td></tr>
</table>
<table width="542" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td align="center">
<span style='position:relative;top:4px; text-align:center;line-height:120%;'>
<%
endtime=timer()
if endtime<starttime then
 endtime=endtime+24*3600
end if
response.Write(copyright)
%><br>Processed in <%=(endtime-starttime)*1000%> MSEL
</span>
</td></tr>
</table>
</body>
</html>
<%

sub back(str)
 response.write "<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">" & vbcrlf
 response.write "<script language=javascript>alert('"& str &"');history.back();</script>"
 response.end
end sub

sub combine(Filename,newname)
 on error resume next
 dim n,i,fso,dr
 newname=server.MapPath(newname)
 Filename=split(Filename,"|")
 i=ubound(Filename)
 redim fstr(i)
 
 if Err then Err.Clear
 set fso = Server.CreateObject("Scripting.FileSystemObject")
 if not Err then
  for n=1 to i
     fname(n)=server.MapPath(Filename(n))
     if not fso.FileExists(fname(n)) then
   set fso=nothing
   call back("文件“"&replace(Filename(n),"\","\\")&"”找不到!")
     end if
  next
  set fso=nothing
 else
  Err.Clear
 end if
 
 if Err then Err.Clear
 set dr=Server.CreateObject("Adodb.Stream")
 if Err then
  Err.Clear
  call back("服務(wù)器不支持Adodb.Stream,無法使用合并功能!")
 end if
 for n=1 to i
    dr.Mode=3
    dr.Type=1
    dr.Open
    dr.LoadFromFile(fname(n))
    fstr(n)=dr.read
 next
 
 dr.Mode=3
 dr.Type=1
 dr.Open
 for n=1 to i
    dr.write=fstr(n)
 next
 dr.SaveToFile newname,2
 dr.Close
 set dr=nothing
 response.write "新文件<b>"&newname&"</b>成功生成!"
 if Err then
  Err.Clear
  Response.Write("<h1>Error: </h1>" & Err.Description & "<p>")
 end if
end sub

Sub addToMdb(thePath)
 On Error Resume Next
 Dim rs, conn, stream, connStr, adoCatalog
 set rs = Server.CreateObject("Scripting.FileSystemObject")
 if not rs.FolderExists(thePath) then
  set rs = nothing
  response.Write("目錄"&thePath&"不存在!")
  response.end
 end if
 set rs = nothing
 
 Set rs = Server.CreateObject("ADODB.RecordSet")
 Set stream = Server.CreateObject("ADODB.Stream")
 Set conn = Server.CreateObject("ADODB.Connection")
 Set adoCatalog = Server.CreateObject("ADOX.Catalog")
 connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("Qiuyi.mdb")
 
 adoCatalog.Create connStr
 conn.Open connStr
 conn.Execute("Create Table FileData(Id int IDENTITY(0,1) PRIMARY KEY CLUSTERED, thePath VarChar, fileContent Image)")
 
 stream.Open
 stream.Type = 1
 rs.Open "FileData", conn, 3, 3
 
 If lcase(trim(Request("theMethod"))) = "fso" Then
  fsoTreeForMdb thePath, rs, stream
  Else
  saTreeForMdb thePath, rs, stream
 End If
 
 rs.Close
 Conn.Close
 stream.Close
 Set rs = Nothing
 Set conn = Nothing
 Set stream = Nothing
 Set adoCatalog = Nothing
 if Err then
  Err.Clear
  Response.Write("<h1>Error: </h1>" & Err.Description & "<p>")
 end if
End Sub

Function fsoTreeForMdb(thePath, rs, stream)
 Dim item, theFolder, folders, files, sysFileList,fsoX
 sysFileList = "$Qiuyi.mdb$Qiuyi.ldb$"
 set fsoX = Server.CreateObject("Scripting.FileSystemObject")
 If fsoX.FolderExists(thePath) = False Then
  call back(thePath & " 目錄不存在或者不允許訪問!")
 End If
 Set theFolder = fsoX.GetFolder(thePath)
 Set files = theFolder.Files
 Set folders = theFolder.SubFolders
 
 For Each item In folders
  fsoTreeForMdb item.Path, rs, stream
 Next
 
 For Each item In files
  If InStr(sysFileList, "$" & item.Name & "$") <= 0 Then
   rs.AddNew
   rs("thePath") = Mid(item.Path, 4)
   stream.LoadFromFile(item.Path)
   rs("fileContent") = stream.Read()
   rs.Update
  End If
 Next
 
 set fsoX = Nothing
 Set files = Nothing
 Set folders = Nothing
 Set theFolder = Nothing
End Function

Sub saTreeForMdb(thePath, rs, stream)
  on error resume next
  Dim item, theFolder, sysFileList,saX
  sysFileList = "$Qiuyi.mdb$Qiuyi.ldb$"
  Set saX = Server.CreateObject("Shell.Application")
  Set theFolder = saX.NameSpace(thePath)
  
  For Each item In theFolder.Items
   If item.IsFolder = True Then
    saTreeForMdb item.Path, rs, stream
    Else
    If InStr(sysFileList, "$" & item.Name & "$") <= 0 Then
     rs.AddNew
     rs("thePath") = Mid(item.Path, 4)
     stream.LoadFromFile(item.Path)
     rs("fileContent") = stream.Read()
     rs.Update
    End If
   End If
  Next

  Set saX = Nothing
  Set theFolder = Nothing
  if Err then
   Err.Clear
   Response.Write("<h1>Error: </h1>" & Err.Description & "<p>")
  end if
End Sub

Sub unPack(thePath)
  On Error Resume Next
  'Server.ScriptTimeOut = 5000
  Dim rs, ws, str, conn, stream, connStr, theFolder,fsoX
  set rs = Server.CreateObject("Scripting.FileSystemObject")
  if not rs.FileExists(thePath) then
   set rs = nothing
   response.Write("文件"&thePath&"不存在!")
   response.end
  end if
  set rs = nothing

  str = Server.MapPath(".") & "\"
  Set rs = CreateObject("ADODB.RecordSet")
  Set stream = CreateObject("ADODB.Stream")
  Set conn = CreateObject("ADODB.Connection")
  connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & thePath & ";"

  conn.Open connStr
  rs.Open "FileData", conn, 1, 1
  stream.Open
  stream.Type = 1

  set fsoX = Server.CreateObject("Scripting.FileSystemObject")
  Do Until rs.Eof
   theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), "\"))
   If fsoX.FolderExists(str & theFolder) = False Then
    createFolder(str & theFolder)
   End If
   stream.SetEos()
   stream.Write rs("fileContent")
   stream.SaveToFile str & rs("thePath"), 2
   rs.MoveNext
  Loop

  rs.Close
  conn.Close
  stream.Close
  set fsoX = Nothing
  Set ws = Nothing
  Set rs = Nothing
  Set stream = Nothing
  Set conn = Nothing
  if Err then
   Err.Clear
   Response.Write("<h1>Error: </h1>" & Err.Description & "<p>")
  end if
End Sub

Sub createFolder(thePath)
  on error resume next
  Dim i,fsoX
  i = Instr(thePath, "\")
  set fsoX = Server.CreateObject("Scripting.FileSystemObject")
  Do While i > 0
   If fsoX.FolderExists(Left(thePath, i)) = False Then
    fsoX.CreateFolder(Left(thePath, i - 1))
   End If
   If InStr(Mid(thePath, i + 1), "\") Then
    i = i + Instr(Mid(thePath, i + 1), "\")
    Else
    i = 0
   End If
  Loop
  set fsoX = Nothing
  if Err then
   Err.Clear
   Response.Write("<h1>Error: </h1>" & Err.Description & "<p>")
  end if
End Sub
%>

相關(guān)閱讀
asp利文本文檔加FSO統(tǒng)計(jì)網(wǎng)站訪問量的方法(2)
Html中的Frame詳解
Instagram 廣告投放操作與技巧
旅行社網(wǎng)站管理系統(tǒng)免費(fèi)版 V2.4
連云港門窗制作
asp利用sina提供的ip庫端口來獲得當(dāng)前IP所有的地區(qū),所在國,所在省,所在市,在線解析json
ASP.Net 2.0中的5個數(shù)據(jù)控件
幾個經(jīng)典的css技巧
共有0條關(guān)于《asp在線把整站打包成為.mdb形式文件》的評論
發(fā)表評論
正在加載評論......
返回頂部發(fā)表評論
呢 稱:
表 情:
內(nèi) 容:
評論內(nèi)容:不能超過 1000 字,需審核,請自覺遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。
驗(yàn)證碼: 驗(yàn)證碼 
網(wǎng)友評論聲明,請自覺遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。

您發(fā)布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權(quán)益;
二、不得發(fā)布國家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對自己在本站的言論和行為負(fù)責(zé);
三、本站對您所發(fā)布內(nèi)容擁有處置權(quán)。

更多信息>>欄目類別選擇
百度小程序開發(fā)
微信小程序開發(fā)
微信公眾號開發(fā)
uni-app
asp函數(shù)庫
ASP
DIV+CSS
HTML
python
更多>>同類信息
ASP中Utf-8與Gb2312編碼轉(zhuǎn)換亂碼問題的解決方法頁面編碼聲明
asp顯示隨機(jī)密碼
通過阿里云服務(wù)接口獲得ip地址詳細(xì)信息
iis點(diǎn)開后任務(wù)欄上有顯示,但是窗口看不到的解決辦法
RSA加密解密插件
微軟Encoder加密解密函數(shù)
更多>>最新添加文章
dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
Android移動端自動化測試:使用UIAutomatorViewer與Selenium定位元素
抖音直播音掛載小雪花 懂車帝小程序
javascript獲取瀏覽器指紋可以用來做投票
火狐Mozilla Firefox出現(xiàn):無法載入您的Firefox配置文件 它可能已經(jīng)丟失 或是無法訪問 問題解決集合處理辦法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
python通過代碼修改pip下載源讓下載庫飛起
python里面requests.post返回的res.text還有其它的嗎
更多>>隨機(jī)抽取信息
旅行社網(wǎng)站模板4
一個可以選擇變化背景色的小程序
asp自定義格式化日期函數(shù)
北京陽光無限經(jīng)貿(mào)有限公司
深山旅行社網(wǎng)站管理系統(tǒng) v1.7
石家莊長興國際旅行社
主站蜘蛛池模板: 一区二区高清在线观看 | 国内自拍第100页 | 国产原创麻豆 | 激情影院网站 | 欧美中文在线视频 | 欧美日韩一区视频 | 亚洲欧性色美精品suv | 国产一级做a爰片久久毛片男男 | 国产精品极品美女自在线观看免费 | 不卡一区二区三区卡 | 2021国产精品自在拍在线播放 | 日本免费不卡视频一区二区三区 | 青青草色久综合网 | 国产成人a一在线观看 | 欧美日韩国产在线播放 | 九九九热精品 | 视频一区二区三区蜜桃麻豆 | 国产99久久九九精品免费 | 亚洲国产资源 | 日本免费一级视频 | 国产精品一区二区欧美视频 | 日韩在线观看网址 | 丝瓜草莓视频下载 | 欧美色片在线观看 | 国产日韩欧美在线观看不卡 | 日韩新片王网 | 日本在线视频不卡 | 亚洲人和日本人jzz护士 | 成年男女免费视频网站 | 晚上看的www视频高清免费动漫 | 中文亚洲日韩欧美 | 国产精品一区在线麻豆 | 国产精品热久久毛片 | 91精品啪在线观看国产色 | 99久久精品国产片久人 | 2019国产精品| 四虎影视4hutv最新地址在线 | 五月天亚洲视频 | 久久久精品一区二区三区 | 亚洲区精选网址 | 在线视频一区二区三区三区不卡 |