這個例子使用文字檔來寫入使用者的資訊建立一個logfile.asp放在每一個asp的頁面的頂端<!--#Include File="LogFile.asp"-->當有人來訪問你的網站logfile.asp自動把他的資訊寫入LogFile.txt,如果相關的URl一樣的話則不寫入檔案 File: LogFile.asp 複製代碼 代碼如下: <% Dim ValidEntry ' Log variable ' First set that this log is valid
asp解碼url 複製代碼 代碼如下: <a href="1.asp?action=<%=server.urlencode("你好")%>">asdf</a> 解碼函數 [code] <% Function URLDecode(enStr) dim deStr,strSpecial dim c,i,v deStr="" strSpecial="!""#$%&'()*+,.-_/:;<=>?@[\]^`{|}~%" for i=1 to
複製代碼 代碼如下:<%@LANGUAGE="JAVASCRIPT"%> <title>Google PR值查詢 asp程式</title> <% function hexdec(str) { return parseInt(str,16); } function zeroFill(a,b) { var z = hexdec(80000000); if (z & a) { a = a>>1; a &= ~z; a |= 0x40000000;
複製代碼 代碼如下: '排序 Function Sort1(ary) Dim KeepChecking,I,FirstValue,SecondValue KeepChecking = TRUE Do Until KeepChecking = FALSE KeepChecking = FALSE For I = 0 to UBound(ary) If I = UBound(ary) Then Exit For If ary(I) > ary(I+1) Then FirstValue =
複製代碼 代碼如下: public function fillzero(l1) if len(l1)=1 then fillzero="0"&l1 else fillzero=l1 end if end function 用法樣本: 複製代碼 代碼如下: response year(now)&month(now)&day(now) 結果:201116 response year(now)&fillzero(month(now))&fillzero(day(now)) 顯示結果:20110106