asp常 用 代 碼

2021-03-31 08:56:31 字數 817 閱讀 8382

顯示頁面載入時間

頁面頂部新增下面的**:

dim strstarttime

dim strendtime

strstarttime = timer '開始時間

%>

頁面(同一頁)的末尾新增:

' 載入完畢的時間

strendtime = timer

response.write ("頁面載入時間: ")

response.write formatnumber(strendtime - strstarttime, 4)

response.write (" 秒.")

%>

顯示字串前20個字元並在結尾處新增「……」

dim cutshort

cutshort = rsyourrecordset.fields.item("yourfield").value

response.write left (cutshort, 20) & "........"

%>

如果動態為空,用預設代替

dim picshow

picshow = rsshowhide.fields.item("shmainpix").value

if picshow <>"" then %>

asp常用函式

array function 返回一個陣列 syntax array list arguments 字元,數字均可 example dim myarray for i 1 to 7 redim preserve myarray i myarray i weekdayname i next resul...

asp常用函式

set jmail server.createobject jmail.tpmail 建立一個jmail物件 jmail.silent true jmail不會丟擲例外錯誤,返回的值為false跟true jmail.logging true 啟用使用日誌 jmail.charset gb2312 ...

Asp 常用函式

textarea顯示用 function htmlencode1 fstring if fstring and not isnull fstring then fstring replace fstring,fstring replace fstring,fstring replace fstrin...

asp常用控制元件

label控制元件 功能說明 用於顯示文字,提示資訊,如窗體標題,文字框的標題 命名字首 lbl aspx 重要屬性 text 顯示的文字 hyperlink控制元件 命名字首 hlk aspx sample imageurl 顯示的url target 目標框架的名稱,如 blank top 等 ...

asp常用函式

array function 返回一個陣列 syntax array list arguments 字元,數字均可 example dim myarray for i 1 to 7 redim preserve myarray i myarray i weekdayname i next resul...