将首页转成静态html页的asp文件

时间:2021-05-18

此程序只能将首页转成静态!(真对一个页面)

将createhtml.asp文件上传到你的空间存放首页文件(index.asp)的目录下
录入网址直接打开createhtml.asp接提示操作就可以了
如果没有转成功可将createhtml.asp更名试一下(如:改成z.asp)录入网址直接打开z.asp
本文件可以随便改名不影响运行
复制代码 代码如下:
<%
ifrequest.QueryString("action")="ok"then
dimkk,url,http,reurl
url=trim(request.Form("url"))
ifurl=""then
url="https://www.jb51.net"
endif
kk=trim(request.Form("ad"))
ifkk=""then
kk="index.html"
endif
reurl=trim(request.Form("reurl"))
sethttp=Server.createobject("Microsoft."&chr(120)&"MLHTTP")
Http.open"GET",url,false
Http.send()
setobjStream=Server.CreateObject("ADODB.Stream")
objStream.type=1
objStream.open
objstream.writehttp.responseBody
objstream.saveToFileserver.mappath(kk),2
response.write"<scriptlanguage='javascript'>"
response.write"alert('发布成功');"
response.write"location.href='"&reurl&"';"
response.write"</script>"
else
%>
<styletype="text/css">
<!--
.STYLE1{
font-size:12px;
color:#FF0000;
}
.STYLE2{
color:#0000FF;
font-size:12px;
}
-->
</style>

<formid="form1"name="form1"method="post"action="http://<%=request.ServerVariables("HTTP_HOST")&request.ServerVariables("SCRIPT_NAME")%>?action=ok">
<table><tr><td>
<spanclass="STYLE2">要转静态的网址:</span></td><td><inputname="url"type="text"id="url"value="https://www.jb51.net"/>
<spanclass="STYLE1">例如https://www.jb51.net本机的文件http://localhost/</span></td>
</tr>
<tr><td><spanclass="STYLE2">存放的路径:</span></td><td>
<inputname="ad"type="text"id="ad"value="index.htm"/>
<spanclass="STYLE1">比如index.html就是保存为和本文件同一目录下的一个index.html</span></td>
</tr>
<tr>
<td><spanclass="STYLE2">转静态后需要跳转到:</span></td>
<td>
<inputname="reurl"type="text"id="reurl"value="index.htm"/>
<spanclass="STYLE1">转静态完成后会有提示框然后确定后就转到您填写的页面</span></td>
</tr>
<tr><td><divalign="right">
</div></td><td><inputtype="submit"name="Submit"value="提交"/></td>
</tr></table>
</form>
<%endif%>
<spanclass="STYLE1">本文件可以随便改名不影响运行</span>

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章