簡單的檢查輸入email是否合法程序

- 中國WEB開發者網絡 (http://www.webasp.net)
-- 技術教程 (http://www.webasp.net/article/)
--- 簡單的檢查輸入email是否合法程序 (http://www.webasp.net/article/1/759.htm)
-- 作者:未知
-- 發佈日期: 2003-04-16
function chkEmail(email)
on error resume next
dim i,l,pos1,pos2
chkEmail=true
if isnull(email) then chkEmail=false:exit function
pos1= instr(email,"@")
pos2=instrRev(email,".")
if not(pos1>0) or not (pos2>0) or pos1>pos2 then
chkEmail=false
end if
if err.number<>0 then err.clear
end function

以上資料由動網先鋒(http://www.aspsky.net)整理製作,轉載請說明出處!

webasp.net