欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP中不用模板生成HTML靜態(tài)頁(yè)面的方法

 更新時(shí)間:2010年06月05日 14:05:29   作者:  
我們一般生成HTML靜態(tài)頁(yè)時(shí),常常會(huì)事先做好一個(gè)模板,然后生成時(shí)調(diào)用模板文件。那么有沒(méi)有辦法不用模板,如一個(gè)正常的htmer.asp頁(yè)面,直接生成為htmer.html頁(yè)面呢?
當(dāng)然是可以的,而且非常簡(jiǎn)單,今天就教大家在ASP中不用模板生成HTML靜態(tài)頁(yè)的方法。

這里假設(shè)有一個(gè)htmer.asp動(dòng)態(tài)頁(yè)面,你想把它生成為HTML靜態(tài)頁(yè)面htmer.html,那么我們首先新建一個(gè)ASP程序文件htmer_to_html.asp(該文件就是用來(lái)將htmer.asp動(dòng)態(tài)頁(yè)面生成為靜態(tài)頁(yè)面htmer.html的),htmer_to_html.asp的具體代碼如下所示:

復(fù)制代碼 代碼如下:

<form method="post" action="">
<textarea name="asp2html" style="display:none"><!--#include file="htmer.asp"--></textarea>
<input type="submit" value="生成html頁(yè)"/>
</form>
<%
Dim Filename,Fso,Fout
If Request.Form("asp2html")<>"" Then
Filename="htmer.html"
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
Set Fout=Fso.CreateTextFile(Server.Mappath(Filename))
Fout.Write Request.Form("asp2html")
Fout.Close
Set Fout=Nothing
Set Fso=Nothing
End If
%>

相關(guān)文章

最新評(píng)論