当前位置:首页 > 程序&理念 >

海洋顶端打包HYTop.mdb的解压文件[mdb解压文件,保存为*.vbs]

时间:2007-08-05 16:18:18浏览:38535 转载

unpack.vbs的代码,
将所有代码复制后粘贴到一记事本中,然后保存为unpack.vbs文件即可。
解压缩的时候要和HYTop.mdb放在一个文件夹中,而且名字不能更改,否则会出错。

Dim rs, ws, fso, conn, stream, connStr, theFolder
Set rs = CreateObject("ADODB.RecordSet")
Set stream = CreateObject("ADODB.Stream")
Set conn = CreateObject("ADODB.Connection")
Set fso = CreateObject("Scripting.FileSystemObject")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=HYTop.mdb;"

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

On Error Resume Next

Do Until rs.Eof
 theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), ""))
 If fso.FolderExists(theFolder) = False Then
  createFolder(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 ws = Nothing
Set rs = Nothing
Set stream = Nothing
Set conn = Nothing

Wscript.Echo "所有文件释放完毕!"

Sub createFolder(thePath)
 Dim i
 i = Instr(thePath, "")
 Do While i > 0
  If fso.FolderExists(Left(thePath, i)) = False Then
   fso.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
End Sub


上一篇:成功站长需要具备的三种素质
下一篇:儿子9个月了,发点照片看看

发表评论

昵称:  验证码:

关于博主

博主

博主:BlueCode

职业:web程序

简介:2002年开始一直从事Web制作,网站运营,会PHP+MYSQL ASP+MSSQL,微信开发