Install.asp
上传用户:bjshenmei
上传日期:2020-11-04
资源大小:3k
文件大小:2k
源码类别:

压缩解压

开发平台:

ASP/ASPX

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <% Option Explicit %>
  3. <% On Error Resume Next %>
  4. <% Response.Charset="UTF-8" %>
  5. <% Server.ScriptTimeout=99999999 %>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>桑尼中国文件解包程序</title>
  11. </head>
  12. <body>
  13. <%
  14. Dim strLocalPath
  15. '得到当前文件夹的物理路径
  16. strLocalPath=Left(Request.ServerVariables("PATH_TRANSLATED"),InStrRev(Request.ServerVariables("PATH_TRANSLATED"),""))
  17. Dim objXmlFile
  18. Dim objNodeList
  19. Dim objFSO
  20. Dim objStream
  21. Dim i,j
  22. Set objXmlFile = Server.CreateObject("Microsoft.XMLDOM")
  23. objXmlFile.load(Server.MapPath("update.xml"))
  24. If objXmlFile.readyState=4 Then
  25. If objXmlFile.parseError.errorCode = 0 Then
  26. Set objNodeList = objXmlFile.documentElement.selectNodes("//folder/path")
  27. Set objFSO = CreateObject("Scripting.FileSystemObject")
  28. j=objNodeList.length-1
  29. For i=0 To j
  30. If objFSO.FolderExists(strLocalPath & objNodeList(i).text)=False Then
  31. objFSO.CreateFolder(strLocalPath & objNodeList(i).text)
  32. End If
  33. Response.Write "创建目录" & objNodeList(i).text & "<br/>"
  34. Response.Flush
  35. Next
  36. Set objFSO = nothing
  37. Set objNodeList = nothing
  38. Set objNodeList = objXmlFile.documentElement.selectNodes("//file/path")
  39. j=objNodeList.length-1
  40. For i=0 To j
  41. Set objStream = CreateObject("ADODB.Stream")
  42. With objStream
  43. .Type = 1
  44. .Open
  45. .Write objNodeList(i).nextSibling.nodeTypedvalue
  46. .SaveToFile strLocalPath & objNodeList(i).text,2
  47. Response.Write "释放文件" & objNodeList(i).text & "<br/>"
  48. Response.Flush
  49. .Close
  50. End With
  51. Set objStream = Nothing
  52. Next
  53. Set objNodeList = nothing
  54. End If
  55. End If
  56. Set objXmlFile = Nothing
  57. response.write "文件解包完毕"
  58. %>
  59. </body>
  60. </html>