chkemail.asp

来自「本程序是一款比较完善的图书租赁系统」· ASP 代码 · 共 40 行

ASP
40
字号
<%
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
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?