此程序只能将首页转成静态!(真对一个页面)
将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="http://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">
<>
</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="http://www.jb51.net"/>
<spanclass="STYLE1">例如http://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>