asp怎么样转换成html
2个回答
展开全部
<%
ID=CheckID(Request.QueryString("ID"))
session("help")=int((10-1+1)*Rnd + 1)
server.ScriptTimeout=9999
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
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
objstream.Close
set objstream = nothing
End Function
'''''''''''''''''''此处是要生成的静态页的地址''''''''''''''''''''''''''''''''''''''''''
txtURL="http://www.51wisdom.com.cn/news_con.asp?id="&id
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sText = getHTTPPage(txtURL)
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
filename=server.MapPath("/")&"/html/"&id&".html"
Set openFile=FileObject.OpenTextfile(filename,2,true) 'true为不存在自行建立
openFile.writeline(sText)
Set OpenFile=nothing
function checksql(kustr)
checksql=server.htmlencode(replace(replace(replace(kustr,"<>"," "),"* from "," "),"="," "))
end function
response.Write("<script language=javascript>alert('信息发布成功!');window.location.href='list.asp';</script>")
%>
ID=CheckID(Request.QueryString("ID"))
session("help")=int((10-1+1)*Rnd + 1)
server.ScriptTimeout=9999
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
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
objstream.Close
set objstream = nothing
End Function
'''''''''''''''''''此处是要生成的静态页的地址''''''''''''''''''''''''''''''''''''''''''
txtURL="http://www.51wisdom.com.cn/news_con.asp?id="&id
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sText = getHTTPPage(txtURL)
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
filename=server.MapPath("/")&"/html/"&id&".html"
Set openFile=FileObject.OpenTextfile(filename,2,true) 'true为不存在自行建立
openFile.writeline(sText)
Set OpenFile=nothing
function checksql(kustr)
checksql=server.htmlencode(replace(replace(replace(kustr,"<>"," "),"* from "," "),"="," "))
end function
response.Write("<script language=javascript>alert('信息发布成功!');window.location.href='list.asp';</script>")
%>
参考资料: http://www.51wisdom.com.cn/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询