set file=fso.opentextfile(server.mappath("html/20061209.htm"),1,true)
filestr=file.readall
response.write filestr
server.mappath("html/20061209.htm") 这里不是很确定,但大概应该是这样
或者用这个函数
Function GetPage(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
getpage返回的是页面的内容
response.write getpage(url)即可显示出来
url是网址
<%On Error Resume Next
dim conn
dim connstr
dim webdb
webdb="xqloginback/xqjtDatabase/xqjtdb.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0Data Source=" &Server.MapPath(""&webdb&"")
conn.Open connstr
newlist=""
set rs=server.CreateObject("adodb.recordset")
sql="select id,name,addtime from new order by id desc"
rs.open sql,conn,1,1
pagesum=10
topage=clng(request("topage"))
if topage<1 then topage=1
rs.pagesize=pagesum
if not rs.eof then
rs.absolutepage=topage
end if
no=1
do while not rs.eof and not rs.bof and pagesum>0
newlist=newlis&"<table width='90%' height='25' border='0' align='center' cellspacing='0'>"
newlist=newlis&"<tr>"
newlist=newlis&"<td width='539'><a href='new_view.asp?id="&rs("id")&"' target='_blank'>"&rs("name")&" </a></td>"
newlist=newlis&"</tr></table>"
<%
rs.movenext
pagesum=pagesum-1
no=no+1
loop
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set templates = fso.OpenTextFile(server.MapPath("template.html"))
str=templates.readall()'读出结果,赋值给str
set fso=nothing
set templates=nothing
str=replace(str,"$newlist$",newlist)
fileName="28ke.html"
Set createHtml = Server.CreateObject("Scripting.FileSystemObject")
Set htmlFile = createHtml.CreateTextFile(server.MapPath(fileName))
htmlFile.write(str)
set htmlFile=nothing
set createHtml=nothing
%>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)