在ASP中使用FSO元件生成HTML頁面

2021-04-06 15:28:29 字數 2851 閱讀 6165

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="

file1=pass

files=file1&".txt"

filez=all_tree2&""&files

set ts = fs.createtextfile(filez,true) '寫檔案

for z=1 to len(msg)

write_now=mid(msg,z,1)

ts.write(write_now)

next

' ts.writeline(all_msg)

ts.close

set ts=nothing    '檔案生成

if err.number<>0 or err then%>

<%else%>

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中使用FSO元件生成HTML頁面

共有兩個頁面index.htm是首頁.程式比較簡單,主要是用了asp裡的檔案操作物件。br untitled document function chan time shijian 轉換日期時間函式 s year year shijian if len s year 2 then s year 20...

在ASP中使用類

vbscript5中增加了許多新功能,最振奮人心的當屬類和正規表示式的出現。以下是本人寫的乙個解析html 的類。我是 學php的,語法有不習慣的地方,請大家多包含。class htmlparse 設定 initialize 事件。private sub class initialize myglo...

在ASP中使用儲存過程

學習使用儲存過程 stored procedure 是asp程式設計師的必須課之一。所有的大型資料庫都支援儲存過程,比如oracle ms sql等,但ms access不支援,不過,在access裡可以使用引數化的查詢 使用儲存過程有許多好處,它可以封裝複雜的資料邏輯,充分發揮大型資料庫本身的優勢...