⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 char.asp

📁 这是个考试系统哦 想学的人可以看看哦
💻 ASP
📖 第 1 页 / 共 5 页
字号:
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

Rem 计算字符串长度
function strLength(str)
       dim WINNT_CHINESE
       WINNT_CHINESE = (len("论坛")=2)

		if isnull(str) then
		 strLength=0
		 exit function
		end if

       if WINNT_CHINESE then
          dim l,t,c,i
          l=len(str)
          t=l
          for i=1 to l
             c=asc(mid(str,i,1))
             if c<0 then c=c+65536
             if c>255 then
                t=t+1
             end if
          next
          strLength=t
       else 
          strLength=len(str)
       end if
       if err.number<>0 then err.clear
end function

Rem 截取字符串
function cutStr(str,strlen)
 if strLength(str)>strlen then
  dim l,t,c,i
  l=len(str)
  t=0
  for i=1 to l
   c=Abs(Asc(Mid(str,i,1)))
   if c>255 then
    t=t+2
   else
    t=t+1
   end if
   if (t>strlen-3) then
    if c>255 then
     cutStr=left(str,i-1)&"……"
    else
     cutStr=left(str,i-1)&"……"
    end if
    exit for
   end if
  next
  
 else
  cutStr=str
 end if
end function

Rem 显示已选择的月份
sub showSelectMonth(showName,nullName)
 dim i
 response.write "<select name='"&showName&"'>"
 if (not isnull(nullName)) and nullName<>"" then 
 response.write "<option value=''>"&nullName&"</option>"
 end if
 for i=1 to 12
 response.write "<option value='"&i&"'>"&i&"</option>"
 next
 response.write "</select>"
 end sub
 
 Rem 显示已选择的日子
 sub showSelectDay(showName,nullName)
 dim i
 response.write "<select name='"&showName&"'>"
 if (not isnull(nullName)) and nullName<>"" then 
 response.write "<option value=''>"&nullName&"</option>"
 end if
 for i=1 to 31
 response.write "<option value='"&i&"'>"&i&"</option>"
 next
 response.write "</select>"
 end sub

Rem JMAIL 发送邮件
Sub Send_JMail(senderemail,sendername,subject,recipient,body)
  Dim msg
  set msg = Server.CreateOBject( "JMail.Message" )
  msg.Logging = true
  msg.silent = true
  msg.From = senderemail
  msg.FromName = sendername
  msg.Charset = "GB2312"  '
  msg.ContentType = "text/html"
  msg.Subject = Subject
  msg.AddRecipient recipient
  msg.Body = Body
  msg.Priority = 3  '60

  msg.Send "mailServer:225"
  Set msg = Nothing  
End Sub

Rem 检查表单输入数据
dim badStr
badStr=""
function checkRequest(p,pt,badStrs,minLen,maxLen,pn,pr)
 dim lp,et,li
 et=""
 li=0
 lp=checkStr(request(p))
 checkRequest=false
 if pt="int" then
  if minLen<>0 and len(lp)=0 then
   checkRequest=true
   et=pr
  end if
  if (minLen<>0) and (not isInt(lp)) then
   checkRequest=true
   et="(无效参数)"
  end if
  
 elseif pt="date" then
  if minLen<>0 and len(lp)=0 then
   checkRequest=true
   et=pr
  end if
  if not isdate(lp) then
   checkRequest=true
   et="(无效日期格式)"
  end if
  
 else
  if len(lp)=0 and minLen>=1 then
   checkRequest=true
   et=pr
  elseif len(lp)<minLen or (len(lp)>maxLen and maxLen<>-1) then
   checkRequest=true
   if minLen>1 then
    et="(长度超出范围。允许范围:<font color=red> "&minLen&" - "&maxLen&" </font>)"
   else
    et="(长度超出范围。最大长度:<font color=red> "&maxLen&" </font>)"
   end if
  end if
  
  for li=1 to len(badStrs)

⌨️ 快捷键说明

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