📄 mycheck.asp
字号:
<%
'是否是整数
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
%>
<%
'用来形成具有日期的编号
timenow=now()
daynow=day(timenow)
monthnow=month(timenow)
hournow=hour(timenow)
minutenow=minute(timenow)
secondnow=second(timenow)
if day(timenow)<10 then
daynow="0"&day(timenow)
end if
if month(timenow)<10 then
monthnow="0"&month(timenow)
end if
if hour(timenow)<10 then
hournow="0"&hour(timenow)
end if
if minute(timenow)<10 then
minutenow="0"&minute(timenow)
end if
if second(timenow)<10 then
secondnow="0"&second(timenow)
end if
dateID=year(timenow)&monthnow&daynow&hournow&minutenow&secondnow
' response.write DateID
%>
<%
'检查电子邮件是否正确
function IsValidEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -