<%
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>")
%>
asp怎么樣轉換成html 代碼
下一篇:虛擬主機如何辦理升級業務
建站咨詢
如您有網站建設方面的需要,歡迎給我們留言或在線咨詢 *