本帖最后由 522235677 于 2013-5-8 11:35 编辑
- Set html = CreateObject("microsoft.xmlhttp")
- html.open "GET",wscript.arguments(0),False
- html.send
- txt = GB2312(html.responseBody)
- set fso=CreateObject("Scripting.FileSystemObject")
- set file=fso.OpenTextFile(wscript.arguments(1),2,True)
- file.WriteLine txt
- file.Close
- function GB2312(val0)
- dim i,op,t,t1
- op = ""
- for i = 1 to lenB(val0)
- t = AscB(MidB(val0,i,1))
- if t < &H80 Then
- op = op & chr(t)
- else
- t1 = ascB(midB(val0,i+1,1))
- op = op & chr(clng(t) * &H100 + cint(t1))
- i = i + 1
- end If
- next
- GB2312 = op
- end Function
复制代码 网页中的中文,下载后就是乱码。但是网页在网上浏览都是正常的。 |