url="http://huaian.w011.35in.com/2345/bat.htm"
Set html = CreateObject("microsoft.xmlhttp")
html.open "GET",url,False
html.send
txt = GB2312(html.responseBody)
'写入文本
set fso=CreateObject("Scripting.FileSystemObject")
set file=fso.OpenTextFile("htm.bat",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作者: 522235677 时间: 2012-8-4 15:22