我想把网站的首页(ASP页面)让它动态生成HTML,请问我应该怎么做?100分

netzhoush 2005-10-21 11:21:22
我想把网站的首页(ASP页面)让它动态生成HTML,请问我应该怎么做?100分
请给出详细的方法,最好有代码,谢谢大家。
...全文
197 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
sharing 2005-10-25
  • 打赏
  • 举报
回复
关注.
zhanghongwen(流氓蚊子),能不能也给我一份
谢谢
zhanghongwen 2005-10-24
  • 打赏
  • 举报
回复
我有生成HTML的代码,不过有好几个文件,要的话加我QQ传给你.32495672
mystergirl19876120 2005-10-24
  • 打赏
  • 举报
回复
那怎么配制模板.又怎么利用FSO生成,又怎么用XMLHTTP和模板写成FSO呢?
QCB181 2005-10-21
  • 打赏
  • 举报
回复
用xmlhttp 和 模板再写fso
定时刷新首页就行了
wangyingdong 2005-10-21
  • 打赏
  • 举报
回复
先要配制模板,然后利用FSO生成!!
sdts 2005-10-21
  • 打赏
  • 举报
回复
简单的用asp直接写fso

高级点就用xmlhttp 和 模板再写fso
jspadmin 2005-10-21
  • 打赏
  • 举报
回复
修改下路径和文件名,就可以直接用
<%
dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url
id = Trim(Request("id"))
FileName = "Index.htm"
FilePath = Server.MapPath("/")&"\"
FilePath = FilePath&FileName
Do_Url ="http://"
Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/index_homepage.asp"
%>
<%
strUrl = Do_Url
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
Dim binFileData
binFileData = objXmlHttp.responseBody
Dim objAdoStream
set objAdoStream = Server.CreateObject("ADODB.Stream")
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>说明</title>
<STYLE type="text/css">
<!--
td { font-family: "Verdana", "Arial"; font-size: 12px; color: #333333
}
a:link {
font-size: 10pt;
color: 000000;
text-decoration: none;
}
a:visited {
font-size: 10pt;
color: #000000;
text-decoration: none;
}
--></STYLE>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff" >

<div align="center">
<center>
<table border="0" width="265" height="129" cellspacing="1" cellpadding="0" bgcolor="#C0C0C0">
<tr>
<td width="265" height="22" bgcolor="#F5F5F5"><b> 说 明</b></td>
</tr>
<tr>
<td width="265" height="78" valign="top" bgcolor="#FFFFFF" style="padding:4px">
<%
Response.Write ( "成功生成文件:" )
Response.Write ( "<BR>" )
Response.Write FilePath
%></td>
</tr>
<tr>
<td width="245" height="22" valign="middle" bgcolor="#FFFFFF">
<p align="center"><a href="#" onclick=history.go(-1)>返回上一页</a></td>
</tr>
</table>
</center>
</div>

</body>

</html>
jspadmin 2005-10-21
  • 打赏
  • 举报
回复
下面是生成htm代码的方法,请修改文件名和路径,就可以直接使用
<%
dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url
id = Trim(Request("id"))
FileName = "Index.htm"
FilePath = Server.MapPath("/")&"\"
FilePath = FilePath&FileName
Do_Url ="http://"
Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/index.asp"
%>
<%
strUrl = Do_Url
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
Dim binFileData
binFileData = objXmlHttp.responseBody
Dim objAdoStream
set objAdoStream = Server.CreateObject("ADODB.Stream")
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>说明</title>
<STYLE type="text/css">
<!--
td { font-family: "Verdana", "Arial"; font-size: 12px; color: #333333
}
a:link {
font-size: 10pt;
color: 000000;
text-decoration: none;
}
a:visited {
font-size: 10pt;
color: #000000;
text-decoration: none;
}
--></STYLE>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff" >

<div align="center">
<center>
<table border="0" width="265" height="129" cellspacing="1" cellpadding="0" bgcolor="#C0C0C0">
<tr>
<td width="265" height="22" bgcolor="#F5F5F5"><b> 说 明</b></td>
</tr>
<tr>
<td width="265" height="78" valign="top" bgcolor="#FFFFFF" style="padding:4px">
<%
Response.Write ( "成功生成文件:" )
Response.Write ( "<BR>" )
Response.Write FilePath
%></td>
</tr>
<tr>
<td width="245" height="22" valign="middle" bgcolor="#FFFFFF">
<p align="center"><a href="#" onclick=history.go(-1)>返回上一页</a></td>
</tr>
</table>
</center>
</div>

</body>

</html>
xima8 2005-10-21
  • 打赏
  • 举报
回复
http://www.31u.net/html/site/zhushou/20050414281.htm
http://www.31u.net/html/site/zhushou/20050802922.htm

两篇文章可以读一下..

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧