將首頁(yè)轉(zhuǎn)成靜態(tài)html頁(yè)的asp文件
更新時(shí)間:2007年03月01日 00:00:00 作者:
此程序只能將首頁(yè)轉(zhuǎn)成靜態(tài)!(真對(duì)一個(gè)頁(yè)面)
將createhtml.asp文件上傳到 你的空間存放首頁(yè)文件(index.asp)的目錄下
錄入網(wǎng)址直接打開(kāi)createhtml.asp接提示操作就可以了
如果沒(méi)有轉(zhuǎn)成功可將createhtml.asp更名試一下(如:改成z.asp)錄入網(wǎng)址直接打開(kāi)z.asp
本文件可以隨便改名不影響運(yùn)行
<%
if request.QueryString("action")="ok" then
dim kk,url,http,reurl
url =trim(request.Form("url"))
if url="" then
url="http://www.fzitv.net"
end if
kk=trim(request.Form("ad"))
if kk="" then
kk="index.html"
end if
reurl=trim(request.Form("reurl"))
set http=Server.createobject("Microsoft."&chr(120)&"MLHTTP")
Http.open "GET",url,false
Http.send()
set objStream = Server.CreateObject("ADODB.Stream")
objStream.type = 1
objStream.open
objstream.write http.responseBody
objstream.saveToFile server.mappath(kk),2
response.write "<script language='javascript'>"
response.write "alert('發(fā)布成功');"
response.write "location.href='"&reurl&"';"
response.write "</script>"
else
%>
<style type="text/css">
<!--
.STYLE1 {
font-size: 12px;
color: #FF0000;
}
.STYLE2 {
color: #0000FF;
font-size: 12px;
}
-->
</style>
<form id="form1" name="form1" method="post" action="http://<%=request.ServerVariables("HTTP_HOST")&request.ServerVariables("SCRIPT_NAME")%>?action=ok">
<table><tr><td>
<span class="STYLE2">要轉(zhuǎn)靜態(tài)的網(wǎng)址:</span></td><td><input name="url" type="text" id="url" value="http://www.fzitv.net" />
<span class="STYLE1">例如http://www.fzitv.net 本機(jī)的文件 http://localhost/</span></td>
</tr>
<tr><td><span class="STYLE2">存放的路徑:</span></td><td>
<input name="ad" type="text" id="ad" value="index.htm"/>
<span class="STYLE1">比如index.html 就是保存為和本文件同一目錄下的一個(gè)index.html</span></td>
</tr>
<tr>
<td><span class="STYLE2">轉(zhuǎn)靜態(tài)后需要跳轉(zhuǎn)到:</span></td>
<td>
<input name="reurl" type="text" id="reurl" value="index.htm" />
<span class="STYLE1">轉(zhuǎn)靜態(tài)完成后會(huì)有提示框然后確定后就轉(zhuǎn)到您填寫的頁(yè)面</span></td>
</tr>
<tr><td><div align="right">
</div></td><td><input type="submit" name="Submit" value="提交" /></td>
</tr></table>
</form>
<%end if%>
<span class="STYLE1">本文件可以隨便改名不影響運(yùn)行</span>
將createhtml.asp文件上傳到 你的空間存放首頁(yè)文件(index.asp)的目錄下
錄入網(wǎng)址直接打開(kāi)createhtml.asp接提示操作就可以了
如果沒(méi)有轉(zhuǎn)成功可將createhtml.asp更名試一下(如:改成z.asp)錄入網(wǎng)址直接打開(kāi)z.asp
本文件可以隨便改名不影響運(yùn)行
復(fù)制代碼 代碼如下:
<%
if request.QueryString("action")="ok" then
dim kk,url,http,reurl
url =trim(request.Form("url"))
if url="" then
url="http://www.fzitv.net"
end if
kk=trim(request.Form("ad"))
if kk="" then
kk="index.html"
end if
reurl=trim(request.Form("reurl"))
set http=Server.createobject("Microsoft."&chr(120)&"MLHTTP")
Http.open "GET",url,false
Http.send()
set objStream = Server.CreateObject("ADODB.Stream")
objStream.type = 1
objStream.open
objstream.write http.responseBody
objstream.saveToFile server.mappath(kk),2
response.write "<script language='javascript'>"
response.write "alert('發(fā)布成功');"
response.write "location.href='"&reurl&"';"
response.write "</script>"
else
%>
<style type="text/css">
<!--
.STYLE1 {
font-size: 12px;
color: #FF0000;
}
.STYLE2 {
color: #0000FF;
font-size: 12px;
}
-->
</style>
<form id="form1" name="form1" method="post" action="http://<%=request.ServerVariables("HTTP_HOST")&request.ServerVariables("SCRIPT_NAME")%>?action=ok">
<table><tr><td>
<span class="STYLE2">要轉(zhuǎn)靜態(tài)的網(wǎng)址:</span></td><td><input name="url" type="text" id="url" value="http://www.fzitv.net" />
<span class="STYLE1">例如http://www.fzitv.net 本機(jī)的文件 http://localhost/</span></td>
</tr>
<tr><td><span class="STYLE2">存放的路徑:</span></td><td>
<input name="ad" type="text" id="ad" value="index.htm"/>
<span class="STYLE1">比如index.html 就是保存為和本文件同一目錄下的一個(gè)index.html</span></td>
</tr>
<tr>
<td><span class="STYLE2">轉(zhuǎn)靜態(tài)后需要跳轉(zhuǎn)到:</span></td>
<td>
<input name="reurl" type="text" id="reurl" value="index.htm" />
<span class="STYLE1">轉(zhuǎn)靜態(tài)完成后會(huì)有提示框然后確定后就轉(zhuǎn)到您填寫的頁(yè)面</span></td>
</tr>
<tr><td><div align="right">
</div></td><td><input type="submit" name="Submit" value="提交" /></td>
</tr></table>
</form>
<%end if%>
<span class="STYLE1">本文件可以隨便改名不影響運(yùn)行</span>
相關(guān)文章
asp提示無(wú)效使用?Null:?Replace的解決方法
這篇文章主要介紹了asp提示無(wú)效使用?Null:?Replace,需要的朋友可以參考下2014-12-12
asp怎么獲取毫秒數(shù)實(shí)現(xiàn)代碼
得到17位的當(dāng)前時(shí)間如:20091210105237238=2009年12月10日10:52:37:238,接下來(lái)在獲取毫秒數(shù),感興趣的朋友可以參考下哈,希望可以幫助到你2013-04-04
ASP下通過(guò)Adodb.Stream實(shí)現(xiàn)多線程下載大文件
這篇文章主要介紹了ASP下通過(guò)Adodb.Stream實(shí)現(xiàn)多線程下載大文件,需要的朋友可以參考下2020-08-08
Jmail組件發(fā)送郵件之絕對(duì)能用的函數(shù)
Jmail組件的這些對(duì)象為服務(wù)器端對(duì)郵件的操作提供了各種各樣的功能,每個(gè)對(duì)象都有其獨(dú)特應(yīng)用2006-12-12
ASP保存遠(yuǎn)程圖片到本地 同時(shí)取得第一張圖片并創(chuàng)建縮略圖的代碼
采集中 或者 在線添加文章中 都可以用到此功能2008-10-10

