主頁(yè) > 知識(shí)庫(kù) > asp下過(guò)濾非法的SQL字符的函數(shù)代碼

asp下過(guò)濾非法的SQL字符的函數(shù)代碼

熱門(mén)標(biāo)簽:長(zhǎng)沙防封電銷(xiāo)卡品牌 徐州人工智能電銷(xiāo)機(jī)器人好用嗎 外呼系統(tǒng)還用卡么 地圖標(biāo)注宅基地 智能電銷(xiāo)機(jī)器人適用于哪些行業(yè) 地圖標(biāo)注服務(wù)哪家好 騰訊地圖標(biāo)注商戶(hù)關(guān)閉 武漢營(yíng)銷(xiāo)電話(huà)機(jī)器人軟件 西寧公司外呼系統(tǒng)平臺(tái)
復(fù)制代碼 代碼如下:

'**************************************************
'函數(shù)名:R
'作 用:過(guò)濾非法的SQL字符
'參 數(shù):strChar-----要過(guò)濾的字符
'返回值:過(guò)濾后的字符
'**************************************************
Public Function R(strChar)
If strChar = "" Or IsNull(strChar) Then R = "":Exit Function
Dim strBadChar, arrBadChar, tempChar, I
'strBadChar = "$,#,',%,^,,?,(,),,>,[,],{,},/,\,;,:," Chr(34) "," Chr(0) ""
strBadChar = "+,',--,%,^,,?,(,),,>,[,],{,},/,\,;,:," Chr(34) "," Chr(0) ""
arrBadChar = Split(strBadChar, ",")
tempChar = strChar
For I = 0 To UBound(arrBadChar)
tempChar = Replace(tempChar, arrBadChar(I), "")
Next
tempChar = Replace(tempChar, "@@", "@")
R = tempChar
End Function
'過(guò)濾xss
Function CheckXSS(ByVal strCode)
Dim Re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern=".[^>]*(style).>"
strCode = re.Replace(strCode, "")
re.Pattern="(a.[^>]*|\/a|li|br|B|\/li|\/B|font.[^>]*|\/font)>"
strCode=re.Replace(strCode,"[$1]")
strCode=Replace(Replace(strCode, "", "lt;"), ">", "gt;")
re.Pattern="\[(a.[^\]]*|\/a|li|br|B|\/li|\/B|font.[^\]]*|\/font)\]"
strCode=re.Replace(strCode,"$1>")
re.Pattern=".[^>]*(on(load|click|dbclick|mouseover|mouseout|mousedown|mouseup|mousewheel|keydown|submit|change|focus)).>"
strCode = re.Replace(strCode, "")
Set Re=Nothing
CheckXSS=strCode
End Function

Function FilterIDs(byval strIDs)
Dim arrIDs,i,strReturn
strIDs=Trim(strIDs)
If Len(strIDs)=0 Then Exit Function
arrIDs=Split(strIDs,",")
For i=0 To Ubound(arrIds)
If ChkClng(Trim(arrIDs(i)))>0 Then
strReturn=strReturn "," Int(arrIDs(i))
End If
Next
If Left(strReturn,1)="," Then strReturn=Right(strReturn,Len(strReturn)-1)
FilterIDs=strReturn
End Function

標(biāo)簽:荊門(mén) 鷹潭 雅安 普洱 通遼 通化 運(yùn)城 巴彥淖爾

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp下過(guò)濾非法的SQL字符的函數(shù)代碼》,本文關(guān)鍵詞  asp,下,過(guò)濾,非法,的,SQL,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp下過(guò)濾非法的SQL字符的函數(shù)代碼》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于asp下過(guò)濾非法的SQL字符的函數(shù)代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章