- ·上一篇文章:站点描述对网站关键词排名有一定的帮助
- ·下一篇文章:一个菜鸟SEO建站的误区
用ASP生成HTML静态页面的代码
<%
'****************************************
'
' ASP源码
'
'FilePath:生成静态页的文件名
'Do_Url:需要生成静态页的ASP文件
'****************************************
Private Sub CreateHtmlPage(FilePath,Do_Url)
FilePath=server.mappath(FilePath)
Dim objXmlHttp
Set objXmlHttp=Server.createObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",Do_Url,false
objXmlHttp.send()
Dim binFileData
binFileData=objXmlHttp.responseBody
Set objXmlHttp=Nothing
Dim objAdoStream
Set objAdoStream=Server.createObject("ADODB.Stream")
objAdoStream.Type=1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
Set objAdoStream=nothing
End Sub
%>
<%
'*********************************************
'以本站为例,把首页文件index.asp生成index.html
'*********************************************
FilePath="index.html"
Do_Url="http://code.px202.com/index.asp"
Call CreateHtmlPage(FilePath,Do_Url)
Response.Write("生成成功")
%>