返回远程动态页面执行后的静态HTML代码

2018-09-06 10:58

阅读:518

  想返回远程动态页面执行后的静态HTML代码然后用邮件发出去!下面是远程获取内容的代码:
content=getHTTPPage(

response.writecontent

functiongetHTTPPage(url)
onerrorresumenext
dimhttp
sethttp=Server.createobject(Msxml(标准化越来越近了)2.xml(标准化越来越近了)HTTP)
Http.openGET,url,false
Http.send()
ifHttp.readystate<>4thenexitfunction
getHTTPPage=bytes2BSTR(Http.responseBody)
sethttp=nothing
iferr.number<>0thenerr.Clear
endfunction

Functionbytes2BSTR(vIn)
dimstrReturn
dimi,ThisCharCode,NextCharCode
strReturn=
Fori=1ToLenB(vIn)
ThisCharCode=AscB(MidB(vIn,i,1))
IfThisCharCode<H80Then
strReturn=strReturnChr(ThisCharCode)
Else
NextCharCode=AscB(MidB(vIn,i+1,1))
strReturn=strReturnChr(CLng(ThisCharCode)*H100+CInt(NextCharCode))
i=i+1
EndIf
Next
bytes2BSTR=strReturn
EndFunction

  技术交流永无止境


评论


亲,登录后才可以留言!