ASP生成靜態(tài)htm頁面基本代碼
更新時間:2007年09月01日 19:08:24 作者:
以下虛線框內(nèi)為mk.asp文件的具體代碼:
--------------------------------------------------------------------------------
<%
filename="test.htm"
if request("body")<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write "標(biāo)題(title):" & request.form("title") & "<br>"
fout.write "內(nèi)容(body):" & request.form("body")
fout.close
set fout=nothing
set fso=nothing
end if
%>
<form name="form1" method="post" action="">
<input name="title" size=18><br>
<textarea name="body"></textarea>
<br>
<br>
<input type="submit" name="Submit" value="生成">
</form>
--------------------------------------------------------------------------------
然后在瀏覽器輸入mk.asp這個頁面,填寫完畢后,就會生成test.htm這個文件,里面的內(nèi)容就是你剛才填寫的。
--------------------------------------------------------------------------------
<%
filename="test.htm"
if request("body")<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write "標(biāo)題(title):" & request.form("title") & "<br>"
fout.write "內(nèi)容(body):" & request.form("body")
fout.close
set fout=nothing
set fso=nothing
end if
%>
<form name="form1" method="post" action="">
<input name="title" size=18><br>
<textarea name="body"></textarea>
<br>
<br>
<input type="submit" name="Submit" value="生成">
</form>
--------------------------------------------------------------------------------
然后在瀏覽器輸入mk.asp這個頁面,填寫完畢后,就會生成test.htm這個文件,里面的內(nèi)容就是你剛才填寫的。
相關(guān)文章
asp兩組字符串?dāng)?shù)據(jù)比較合并相同數(shù)據(jù)
兩組字符串?dāng)?shù)據(jù),需要比較其中相同的數(shù)據(jù),并將其值相加并組成一個新的字符串?dāng)?shù)據(jù)2008-08-08
關(guān)于ASP循環(huán)表格的問題之解答[比較詳細(xì)]
在很多時候,我們采用原始的方法來解決一行內(nèi)循環(huán)3張圖片,如果上傳者只上傳了2張圖片,那么2張圖片間的距離會很大,因為缺少了一個<td> </td>.2008-11-11
asp下根據(jù)標(biāo)題生成關(guān)鍵字的代碼
實現(xiàn)的功能是:標(biāo)題+標(biāo)題里除去非中文及中文標(biāo)點外的字符的、相鄰兩個字符的集合 傳說中這是采集文章處理keywords的最佳方式,呵呵,做了一個,用下試試2008-06-06
重置TSYS系統(tǒng)中的所有"生成的文件"成"未生成文件"
重置TSYS系統(tǒng)中的所有"生成的文件"成"未生成文件"...2007-01-01

