|
|
发表于 2011-5-20 22:14:55
|
显示全部楼层
因为没有具体的文件夹及文件数据,下面给出单个的处理示例(html和txt文件全用temp名)
- Set fso = CreateObject("scripting.filesystemobject")
- Set ws = CreateObject("WScript.shell")
- vbstr = Replace(fso.OpenTextFile("temp.html", 1, 1).ReadAll(), "<pre>", "<pre id=text>")
- fso.OpenTextFile("temp.html", 2, 1).Write vbstr
- GetStr ws.CurrentDirectory & "\temp.html"
- Set fso = Nothing
- Set ws = nothing
- MsgBox "ok"
- Function GetStr(pathfile)
- Set oDOM = GetObject(pathfile, "htmlfile")
- Do Until oDOM.readyState="complete":WScript.Sleep 200:Loop
- txt = oDOM.getElementByid("text").innertext
- fso.OpenTextFile("temp.txt", 2, 1).Write txt
- Set oDOM = Nothing
- End Function
复制代码 |
评分
-
查看全部评分
|