国产探花免费观看_亚洲丰满少妇自慰呻吟_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

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

圖片精選

主站蜘蛛池模板: 兴山县| 莆田市| 如皋市| 紫阳县| 常山县| 广元市| 兴仁县| 冷水江市| 平度市| 环江| 平利县| 岳西县| 龙井市| 余庆县| 吴桥县| 临高县| 安阳市| 文成县| 惠安县| 诏安县| 寻乌县| 揭阳市| 榕江县| 隆安县| 长泰县| 临安市| 舒城县| 游戏| 神木县| 临邑县| 光泽县| 定西市| 扶沟县| 杨浦区| 基隆市| 杂多县| 惠州市| 潞西市| 故城县| 游戏| 海丰县|