使用asp生成html檔案
使用asp生成html檔案
'共有兩個頁面index.htm是首頁.程式比較簡單,主要是用了asp裡的檔案操作物件。
'//send.asp
<%
function chan_time(shijian)'轉換日期時間函式
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
s_hour=hour(shijian)
if s_hour<10 then s_hour="0"&s_hour
s_minute=minute(shijian)
if s_minute<10 then s_minute="0"&s_minute
chan_time=s_year & s_month & s_day & s_hour & s_minute
end function
function chan_data(shijian) '轉換日期時間函式
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
chan_data=s_year & s_month & s_day
end function
function chan_file(shijian)'轉換日期時間函式
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
s_hour=hour(shijian)
if s_hour<10 then s_hour="0"&s_hour
s_minute=minute(shijian)
if s_minute<10 then s_minute="0"&s_minute
s_ss=second(shijian)
if s_ss<10 then s_ss="0"&s_ss
chan_file = s_month & s_day & s_hour & s_minute & s_ss
end function
top=""
botom="
<%else%>
myfile.name= left(myfile.name,len(myfile.name)-4)&".htm"
set myfile=nothing
set fs=nothing
set fdir=nothing
function get_pass(pass)
pass=cstr(pass)
pass=replace(pass," ","")
pass=replace(pass," ","")
pass=replace(pass,"-","")
pass=replace(pass," ","")
pass=replace(pass,":","")
pass=replace(pass,".","")
pass=replace(pass,"+","")
pass=replace(pass,"_","")
pass=replace(pass,"<","")
pass=replace(pass,">","")
pass=replace(pass,"!","")
pass=replace(pass,"@","")
pass=replace(pass,"#","")
pass=replace(pass,"$","")
pass=replace(pass,"%","")
pass=replace(pass,"^","")
pass=replace(pass,"&","")
pass=replace(pass,"*","")
pass=replace(pass,"(","")
pass=replace(pass,")","")
pass=replace(pass,"=","")
pass=replace(pass,"/","")
pass=replace(pass,"/","")
pass=replace(pass,"|","")
get_pass=pass
end function
%>
把send.asp和index.htm放到你的asp目錄下,然後再建乙個news資料夾。開啟瀏覽器,在位址列裡輸入:http://你的機器名/你的asp虛擬目錄名/index.html輸入文字,然後提交,ok!看看你的asp目錄裡新建的news資料夾裡是不是多了個新的資料夾,而且是以當前日期命名的。裡面有你剛剛提交的文字,看看是不是生成了html檔案。怎麼樣,你可以在此基礎上做個簡單的新聞發布系統。。
使用ASP生成HTML檔案
使用asp生成html檔案 使用asp生成html檔案 共有兩個頁面index.htm是首頁.程式比較簡單,主要是用了asp裡的檔案操作物件。send.asp function chan time shijian 轉換日期時間函式 s year year shijian if len s year ...
ASP生成靜態Html檔案技術
1,下面這個例子直接利用fso把html 寫入到檔案中然後生成.html格式的檔案 htmlwrite.write 輸出title內容 request.form title 輸出body內容 request.form body htmlwrite.close set fout nothing set...
ASP生成靜態Html檔案技術雜談
asp生成靜態html檔案技術雜談 進入社群 網頁生成靜態html檔案有許多好處,比如生成html網頁有利於被搜尋引擎收錄,不僅被收錄的快還收錄的全。前台脫離了資料訪問,減輕對資料庫訪問的壓力,加快網頁開啟速度。像www。aspid。cn的主站就採用了tsys生成html檔案!所以吟清最近對生成ht...