asp 驗(yàn)證用戶名是否包含有非常字符的函數(shù)
更新時(shí)間:2007年08月08日 12:09:32 作者:
<%
'******************************
'函數(shù):IsValidUserName(byVal UserName)
'參數(shù):UserName,用戶名稱
'作者:阿里西西
'日期:2007/7/15
'描述:驗(yàn)證用戶名是否包含有非法字符,不含非法字符返回:true
'示例:IsValidUserName(byVal UserName)
'******************************
Function IsValidUserName(byVal UserName)
Dim i,c
IsValidUserName = True
For i = 1 To Len(UserName)
c = Lcase(Mid(UserName, i, 1))
If InStr("$!<>?#^%@~`&*();:+='"" ", c) > 0 Then
IsValidUserName = False
Exit Function
End IF
Next
End Function
%>
'******************************
'函數(shù):IsValidUserName(byVal UserName)
'參數(shù):UserName,用戶名稱
'作者:阿里西西
'日期:2007/7/15
'描述:驗(yàn)證用戶名是否包含有非法字符,不含非法字符返回:true
'示例:IsValidUserName(byVal UserName)
'******************************
Function IsValidUserName(byVal UserName)
Dim i,c
IsValidUserName = True
For i = 1 To Len(UserName)
c = Lcase(Mid(UserName, i, 1))
If InStr("$!<>?#^%@~`&*();:+='"" ", c) > 0 Then
IsValidUserName = False
Exit Function
End IF
Next
End Function
%>
相關(guān)文章
Active Server Pages 錯(cuò)誤 ''ASP 0201'' 修復(fù)方法
網(wǎng)上很多其他的解決方法, 但是我試了幾個(gè)小時(shí), 都沒有解決問題, 最后是通過這個(gè)方法解決的.2010-07-07
asp執(zhí)行帶參數(shù)的sql語句實(shí)例
這篇文章主要介紹了asp執(zhí)行帶參數(shù)的sql語句實(shí)例,參數(shù)化SQL語句可以有效的防止SQL注入漏洞,需要的朋友可以參考下2014-08-08
用ASP實(shí)現(xiàn)對ORACLE數(shù)據(jù)庫的操作
用ASP實(shí)現(xiàn)對ORACLE數(shù)據(jù)庫的操作...2007-03-03
使用ODBC數(shù)據(jù)庫管理Serv-U的FTP用戶及相關(guān)ASP編程[附源碼示例下載]
使用ODBC數(shù)據(jù)庫管理Serv-U的FTP用戶及相關(guān)ASP編程[附源碼示例下載]...2007-11-11
ASP下實(shí)現(xiàn)自動(dòng)采集程序及入庫的代碼
ASP下實(shí)現(xiàn)自動(dòng)采集程序及入庫的代碼...2007-03-03
asp頁面提示Response 對象 錯(cuò)誤 ASP 0156 : 80004005 HTTP 頭錯(cuò)誤
訪問asp頁面時(shí)提示Response 對象 錯(cuò)誤 ASP 0156 : 80004005 HTTP 頭錯(cuò)誤?,行 0 已將 HTTP 頭輸出到客戶端瀏覽器。任何對 HTTP 頭的修改都必須在輸出頁內(nèi)容之前進(jìn)行。2011-09-09

