以下虛線框內為mk.asp文件的具體代碼:
--------------------------------------------------------------------------------
<%
filename="test.htm"
if request("body")<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write "標題(title):" & request.form("title") & "<br>"
fout.write "內容(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這個文件,裡面的內容就是你剛才填寫的。