FSO生成ASP静态页面
1个回答
展开全部
Server.ScriptTimeOut=50000
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function GetBody(strUrl)
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
GetBody= objXmlHttp.responseBody
set objXmlHttp=nothing
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
'response.write BytesToBstr
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
Dim wstr,str,url,start,over,dtime
url="http://127.0.0.1/a.asp" '要生成页面的网页地址
wstr=getHTTPPage(url)
Set fso = CreateObject("Scripting.FileSystemObject")
Set txt=fso.OpenTextFile(server.mappath("/a.html"),2,True)
txt.WriteLine(wstr)
txt.Close
Set txt = Nothing
Set fso = Nothing
response.write "/a.html 创建成功!"+cstr(now())
response.write "<br>"
在你的站点要目录下
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function GetBody(strUrl)
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
GetBody= objXmlHttp.responseBody
set objXmlHttp=nothing
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
'response.write BytesToBstr
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
Dim wstr,str,url,start,over,dtime
url="http://127.0.0.1/a.asp" '要生成页面的网页地址
wstr=getHTTPPage(url)
Set fso = CreateObject("Scripting.FileSystemObject")
Set txt=fso.OpenTextFile(server.mappath("/a.html"),2,True)
txt.WriteLine(wstr)
txt.Close
Set txt = Nothing
Set fso = Nothing
response.write "/a.html 创建成功!"+cstr(now())
response.write "<br>"
在你的站点要目录下
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询