国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

unpack.vbs

2019-10-26 18:08:49
字體:
來源:轉載
供稿:網友

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 宁化县| 东乌珠穆沁旗| 阿克苏市| 彰化县| 西平县| 都江堰市| 万州区| 辉县市| 鸡西市| 江口县| 营口市| 革吉县| 龙胜| 蓝山县| 高密市| 嵊州市| 共和县| 江油市| 孝昌县| 富蕴县| 牟定县| 玛多县| 屏东市| 姜堰市| 临高县| 宜州市| 邹平县| 凤山县| 荥经县| 祥云县| 洛阳市| 柏乡县| 孟津县| 永宁县| 松溪县| 民勤县| 朔州市| 乐清市| 石楼县| 垣曲县| 昌图县|