国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp form 表單驗證函數

2024-05-04 11:09:00
字體:
來源:轉載
供稿:網友
比較不錯一些表單驗證函數,大家可以參考下
 
 
 
'************************************* 
'檢測是否只包含英文和數字 
'************************************* 

Function IsvalidValue(ArrayN, Str) 
IsvalidValue = False 
Dim GName 
For Each GName in ArrayN 
If Str = GName Then 
IsvalidValue = True 
Exit For 
End If 
Next 
End Function 

'************************************* 
'檢測是否有效的數字 
'************************************* 

Function IsInteger(Para) 
IsInteger = False 
If Not (IsNull(Para) Or Trim(Para) = "" Or Not IsNumeric(Para)) Then 
IsInteger = True 
End If 
End Function 

'************************************* 
'用戶名檢測 
'************************************* 

Function IsValidUserName(byVal UserName) 
Dim i, c 
Dim VUserName 
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 
For Each VUserName in Register_UserName 
If UserName = VUserName Then 
IsValidUserName = False 
Exit For 
End If 
Next 
End Function 

'************************************* 
'檢測是否有效的E-mail地址 
'************************************* 

Function IsValidEmail(Email) 
Dim names, Name, i, c 
IsValidEmail = True 
Names = Split(email, "@") 
If UBound(names) <> 1 Then 
IsValidEmail = False 
Exit Function 
End If 
For Each Name IN names 
If Len(Name) <= 0 Then 
IsValidEmail = False 
Exit Function 
End If 
For i = 1 To Len(Name) 
c = LCase(Mid(Name, i, 1)) 
If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) Then 
IsValidEmail = False 
Exit Function 
End If 
Next 
If Left(Name, 1) = "." Or Right(Name, 1) = "." Then 
IsValidEmail = False 
Exit Function 
End If 
Next 
If InStr(names(1), ".") <= 0 Then 
IsValidEmail = False 
Exit Function 
End If 
i = Len(names(1)) - InStrRev(names(1), ".") 
If i <> 2 And i <> 3 Then 
IsValidEmail = False 
Exit Function 
End If 
If InStr(email, "..") > 0 Then 
IsValidEmail = False 
End If 
End Function
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 雷山县| 彰化市| 综艺| 满城县| 长顺县| 昭通市| 稻城县| 乌拉特前旗| 平定县| 高尔夫| 襄樊市| 建水县| 昌平区| 定陶县| 岗巴县| 思茅市| 聂荣县| 遂昌县| 广宗县| 红原县| 贡嘎县| 云和县| 华亭县| 曲阜市| 莱阳市| 伊宁县| 上虞市| 永兴县| 玛多县| 二连浩特市| 新丰县| 广河县| 印江| 什邡市| 沈丘县| 潍坊市| 隆子县| 绥棱县| 舒兰市| 仲巴县| 阿合奇县|