您现在的位置:首页 >> ASP >> 内容

几个常用的asp函数

时间:2013-6-15 17:15:39 点击:

  核心提示:Function ChkStr(InString) '非法字符过滤函数If InString'' ThenInString=Replace(LCase(InString),' ','')InStrin...
 Function ChkStr(InString) '非法字符过滤函数
  If InString<>"" Then
   InString=Replace(LCase(InString)," ","")
   InString=Replace(LCase(InString),";","")
   InString=Replace(LCase(InString),"'","")
   InString=Replace(LCase(Instring),"--","")
   Instring=Replace(LCase(Instring),"%","")
   InString=Replace(LCase(InString),"%20","")
  
   InString=Replace(LCase(InString),"admin","")
  
   InString=Replace(LCase(InString),"and","")
   InString=Replace(LCase(InString),"or","")
  
   InString=Replace(LCase(InString),"asc","")
   InString=Replace(LCase(Instring),"chr","")
   InString=Replace(LCase(InString),"mid","")
   InString=Replace(LCase(InString),"len","")
  
   InString=Replace(LCase(InString),"select","")
   InString=Replace(LCase(InString),"insert","")
   InString=Replace(LCase(InString),"delete","")
   InString=Replace(LCase(InString),"update","")
  
  
   ChkStr=InString
  End If
  End Function
  
  Function CheckFileExt(FileExt) '检测文件扩展名
   Dim FileAccessExt,AccessExt
   AccessExt="gif,jpg,jpeg,bmp,doc,txt,png"
   FileAccessExt=Split(AccessExt,",")
   For i=LBound(FileAccessExt) to UBound(FileAccessExt)
   If LCase(FileExt)=LCase(FileAccessExt(i)) Then
   CheckFileExt=True
   Else
   CheckFileExt=False
   End If
   Next
  End Function
  
  Function CheckStr(str,IsStr) '检查非法字符和数字数据
  CheckStr=str
  If IsStr And InStr(str,",")>0 Then
   Call errmsg("提交字符中包含非法字符")
  ElseIf (Not IsStr) And (Not IsNumeric(str)) Then
   Call errmsg("提交不是数字型")
  End If
  End Function
  
  Sub errmsg(str)
   If Not IsNull(str) Then
   Response.Write(str)&"< br >"
   Call ASCpy()
   Response.End() 
   End If
  End Sub
  
  
   Sub ASCpy()
   Response.Write "<link href='Css/Maincss.css' rel='stylesheet' type='text/css'>"
   Response.Write "<div align='center' class='Maincss'>"
   Response.Write("<Center>Error happed!<br>Please Contract ")
   Response.Write("Name:<a href='mailto:jdqn@sjzu.edu.cn' style='text-decoration:none'>")
   Response.Write("<font Color=red>AloneSword</font>")
   Response.Write("</a>.<br>Thank you!!!</Center><br>")
   Response.Write "<hr>Copyright © By <a href='#' style='text-decoration:none'>建大网络</a> ™<br>"
   Response.Write "Last Modified:21/08/2004<br>"
   Response.Write("Author:<a href='http://blog.csdn.net/alonesword/' style='text-decoration:none' target='_blank'>AloneSword</a>")
   Response.Write "</div>"
  End Sub 
   
更多关于asp 的教程

作者:佚名 来源:不详
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
本类推荐
  • 没有
本类固顶
  • 没有
  • 青春网络编程技术(www.qcfupo.com) © 2021 版权所有 All Rights Reserved.
  • Powered by qcfupo! V3.0sp1
  • 百度友情链接: 百家乐[www.chinawestnews.net/aomenbaijiale/] 赌博网[www.chinawestnews.net/amdbwz/] 海立方[www.bjl.gov.cn/bjgylc/] 娱乐城[www.gtxrmzf.gov.cn/mapai/] 娱乐城[www.hfsf.gov.cn/yfgj/] 威尼斯人[www.hllinkou.gov.cn/baijile/] 澳门威尼斯[www.jjwgj.gov.cn/wnsr/] 888真人[www.lagm.gov.cn/888zhenren/] 百乐坊[www.laoling.gov.cn/blfylc/] 现金网[www.longyu.gov.cn/xjw/] 百家乐[www.chinawestnews.net/ambjl/] 新葡京娱乐场[www.sjzedu.gov.cn/jsylc/] 时时彩[www.snjw.gov.cn/ssc/] 赌博[www.chinawestnews.net/aomendubo/]