国产探花免费观看_亚洲丰满少妇自慰呻吟_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
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 濉溪县| 马边| 塘沽区| 安岳县| 瓦房店市| 罗田县| 九寨沟县| 隆化县| 介休市| 临夏市| 东莞市| 长武县| 永福县| 兴山县| 余庆县| 绍兴市| 增城市| 安图县| 山东省| 咸阳市| 泌阳县| 赣榆县| 城步| 高邑县| 南宁市| 昭苏县| 南陵县| 武定县| 新乡市| 英山县| 贵港市| 晋宁县| 高安市| 上栗县| 全南县| 福州市| 嘉黎县| 巴彦淖尔市| 九寨沟县| 青河县| 临汾市|