當然這應該屬於正常過濾手法,而還有一種過濾HTML標籤的最終極手法,則是將一對角括弧及角括弧中的所有字元均替換不顯示,該方法對於內容中必須描述有關角括弧內容過濾過頭了。 不過,總歸是有需要將所有角括弧中內容全部替換的時候,很顯然是需要進行正則的,有兩種代碼,第一種如下: 複製代碼 代碼如下:Function nohtml(str) dim re Set re=new RegExp re.IgnoreCase =true re.Global=True re.Pattern="(\<.[^
預存程序採用的是select top 加 not in的方式完成,速度也算是相當快了 我測試過了百萬級資料量一般查詢在1秒一下,貼出來大家交流下,看有沒有什麼好的建議。 簡單幾句話就可以實現分頁功能,請看代碼: 最簡單使用方法(適用於任何資料表): test.asp 複製代碼 代碼如下:<!--#include file="conn.asp"--> <!--#include file="Page.asp"--> <% Set My = New Page With
直接看代碼: 複製代碼 代碼如下:Class GoogleTranslator sub Class_Initialize() RURI="http://translate.google.com/translate_t?langpair={0}&text={1}" End Sub Private Opt_ ' Property Get Opt Opt=Opt_ End Property Property Let Opt(Opt_s) Opt_=Opt_s End Property Private
由於代碼比較短,這裡就不進行注釋了 複製代碼 代碼如下:<% '當目標頁面的包含檔案即#include的頁面裡邊存在response.End()的時候本程式有問題 '注意:本檔案一定要放在20041227111723.htm指向的檔案的同一目錄下 dim hughchiu_rtcode Function get_exe_code(20041227111723.htm) dim execode dim tmp_str Dim
Function content_Code(Str) dim ary_String,i,n,n_pos ary_String=split(Str,"[ code ]") n=ubound(ary_String) If n<1 then content_Code=Str Exit function End If for i=1 to n n_pos=inStr(ary_String(i),"[/ code ]") If n_pos>0 then
如果在session級儲存一個dictionary對象會降低系統的效能,而在application級儲存一個dictionary對象會導致web伺服器崩潰,關於這個就不在多說了。 現在我們要考慮的是dictionary對象在單頁的時候,有哪些設計時的缺陷: 大家可以這麼試試 set rs=server.createobject("adodb.recordset") sql="select * from table" rs.open sql,conn,1,3 set
Function getIpvalue(clientIP)'得到用戶端的IP轉換成長整型,傳回值getIpvalue On Error Resume Next Dim strIp, array_Ip strIp=0 array_Ip = Split(clientIP,".") If UBound(array_Ip)<>3 Then getIpvalue=0 Exit Function End If For i=0 To 3 strIp=strIp+(CInt(array_Ip(i))
假設在搜尋方塊search中輸入:“asp 編程” 先得到輸入框中的內容:search=request("search") 然後將這兩個值分別取出來 s=split(search," ") '構造sql函數 sql="select * from news" for i=0 to ubound(s) m=m&" or title='"&s(i)&"'" next '在這裡會發現得到的m前面多了一個or,所以要去掉 m=right(m,len(m)-3) '將m串連到sql語句上 sql=sql&"
程式碼: 以下為引用的內容: 複製代碼 代碼如下:'關鍵字的搜尋 str="select * from tableName where id>4" if srhKey<>"" then keyArr=split(srhKey," ") j=UBound(keyArr) t=0 dim keystrArr() for i=0 to j if keyArr(i)<>"" then redim preserve keystrArr(t)
<%@ language=vbscript codepage=65001%> <% 'Filename must be input if Request("Filename")="" then response.write "<h1>Error:</h1>Filename is empty!<p>" else call downloadFile(replace(replace(Request("Filename"),"\",""),"/","