想把index.asp转化成index.html 具体怎么操作! 要详细的!~若成功后一定再加20分!~ i-ip@foxmail.com 30
1个回答
展开全部
<%
dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url,Html_Temp
Html_Temp="<UL>"
For i=1 To 3
Html_Temp = Html_Temp&"<LI>"
Item_Classid = i
FileName = "Index.html"
FilePath = Server.MapPath("/")&"\"&FileName
Html_Temp = Html_Temp&FilePath&"</LI>"
Do_Url = "http://"
Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/indexbak.asp"
Do_Url = Do_Url&"?Item_Classid="&Item_Classid
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()
Next
Html_Temp = Html_Temp&"<UL>"
%>
<%
' Response.Write ( "成功生成文件:" )
' Response.Write ( "<BR>" )
' Response.Write Html_Temp
response.Write("<script>alert('首页生成成功!');history.back();</script>")
response.End()
%>
把这段代码放在一个MAKE_INDEX.ASP页面的,你只要一运行这个页面,就可以生成一个INDEX.HTML静态页面的。
dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url,Html_Temp
Html_Temp="<UL>"
For i=1 To 3
Html_Temp = Html_Temp&"<LI>"
Item_Classid = i
FileName = "Index.html"
FilePath = Server.MapPath("/")&"\"&FileName
Html_Temp = Html_Temp&FilePath&"</LI>"
Do_Url = "http://"
Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/indexbak.asp"
Do_Url = Do_Url&"?Item_Classid="&Item_Classid
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()
Next
Html_Temp = Html_Temp&"<UL>"
%>
<%
' Response.Write ( "成功生成文件:" )
' Response.Write ( "<BR>" )
' Response.Write Html_Temp
response.Write("<script>alert('首页生成成功!');history.back();</script>")
response.End()
%>
把这段代码放在一个MAKE_INDEX.ASP页面的,你只要一运行这个页面,就可以生成一个INDEX.HTML静态页面的。
追问
没有看到 MAKE_INDEX.ASP有这个文件哦``
可以留下你的QQ吗?或者给我发邮件i-ip@foxmail.com
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询