ASP生成静态页面代码!

ASP生成静态页面代码!

给一个完整的代码。谢谢!
可以找我啊.嘿嘿Q774665
以下代码为本站所用代码,供大家交流。

ID=CheckID(Request.QueryString("ID")) '此处请求刚刚添加的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("")
找源码
有三种方法
1.采用伪静态重写,比较实际些
2.采用模板裂虚替换生成
3.采用xmlhttp浏览生成

这里有个参考肆顷燃例子,乎滑看看
← 上一篇: 下一篇: →