複製代碼 代碼如下:using System.Collections.Generic; using System.Web; using System; namespace DataAccess { /// <summary> /// 緩衝控制類 /// </summary> public class CacheControl { public static List<string> AllUseCacheKey = new List<string>
複製代碼 代碼如下:Dim re Set re = new RegExp '建立RegExp執行個體 re.Pattern = "ab+c" '定義Regex文字,你可以在這裡替換Regex Dim myString myString = "abcefg" '定義要匹配的字串,可以進行替換 Response.write(re.Execute(myString)(0)) '進行匹配測試,並寫出結果 複製代碼 代碼如下:<% Dim re Set re = new RegExp
下面給出4個函數,足夠你抵擋一切SQL注入漏洞!讀懂代碼,你就能融會貫通。 注意要對所有的request對象進行過濾:包括 request.cookie, request.ServerVariables 等等容易被忽視的對象: 複製代碼 代碼如下:function killn(byval s1) '過濾數值型參數 if not isnumeric(s1) then killn=0 else if s1<0 or s1>2147483647 then killn=0 else
這個例子使用文字檔來寫入使用者的資訊建立一個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
複製代碼 代碼如下:'============================== '格式化HTML,SDCMS加強版 '============================== Function Nohtml(ByVal t0) IF Len(t0)=0 Or IsNull(t0) Then Nohtml="" Exit Function End IF Dim Regs,Matches,Match Set Regs=New Regexp Regs.Ignorecase=True Regs.
有一個問題就是 :表單名稱和對象的屬性名稱(我是屬性賦值 你也可以用欄位)要保持一樣,,有點不安全,不過後台用挺好的,在說填寫表單資料後台用的比較多複製代碼 代碼如下:using System; using System.Data; using System.Configuration; using System.Collections; using System.Collections.Generic; using System.Reflection; using
複製代碼 代碼如下:function checkip(checkstring)'用正則判斷IP是否合法 dim re1 set re1=new RegExp re1.pattern="^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$" re1.global=false re1.Ignorecase=false checkip=re1.test(checkstring) set re1=nothing end function 複製代碼