您好,欢迎访问三七文档
易易充值-方便快捷,安全稳定易易充值-方便快捷,安全稳定ASP功能函数大全在这里给大家献上ASP各种函数功能木块集合,这里几乎包含了常用的ASP函数,对网站开发时有着很大的帮助!%callstart()'开始执行Functionstart()callget_rq()'安全过滤'callAppeal()'防小偷程序callwebAgent()'检测客户端EndFunctionFunctioncreateRs()dimrsObjsetrsObj=server.CreateObject(adodb.recordset)setcreateRs=rsObjEndFunctionsubshowError(strval)response.Writedivstyle=border:1solid#0099FF;width:500px;height:250px;response.Writestrvalresponse.Write/divresponse.End()endsub'转向SubRedirectUrl(strHttp)Response.writescriptlanguage='javascript'location.href='&strHttp&';/scriptEndSubsubAlert(sText)Response.writescriptlanguage='javascript'alert('&sText&');/scriptendsubsubHistory(iStep)Response.writescriptwindow.history(&iStep&);/scriptEndSubsubFunmsg(iStep,sText)Response.Writescriptalert('&sText&');location.href='&iStep&';/scriptendsub易易充值-方便快捷,安全稳定易易充值-方便快捷,安全稳定'执行非法提交检测Subget_rq()dimqs,errc,iiiqs=request.servervariables(query_string)dimnothis(18)nothis(0)=netusernothis(1)=xp_cmdshellnothis(2)=/addnothis(3)=exec%20master.dbo.xp_cmdshellnothis(4)=netlocalgroupadministratorsnothis(5)=selectnothis(6)=countnothis(7)=ascnothis(8)=charnothis(9)=midnothis(10)='nothis(11)=::nothis(12)=nothis(13)=insertnothis(14)=deletenothis(15)=dropnothis(16)=truncatenothis(17)=fromnothis(18)=anduser0errc=falseforiii=0toubound(nothis)ifinstr(qs,nothis(iii))0thenerrc=trueendifnextiferrcthen'Response.Write(对不起,非法URL地址请求!)response.Writemetahttp-equiv=Refreshcontent=3;URL=index.htmlresponse.Writedivstyle='border:1pxsolid#CCCCCC;width:600px;height:25px;padding:5px;padding-left:15px;'response.Writefontstyle='font-size:14px'Diggcms系统友情提示:brresponse.Write HTTP错误404-URL地址请求出错brresponse.Write/divresponse.endendifEndSub'初始化被过滤的客户端列表FunctionwebAgent()易易充值-方便快捷,安全稳定易易充值-方便快捷,安全稳定dimstrAgentFilterstrAgentFilter=webzip|||flashget|||offline|||teleportIfChkAgent(strAgentFilter)=FalseThenresponse.Write错误response.End()'AddErrCode(1)'CallChkError()EndIfEndFunction'*检查浏览站点的客户端'*strAL——屏蔽的客户端标志列表FunctionChkAgent(strAL)DimAgent,iijjChkAgent=TrueAgent=Trim(Lcase(Request.Servervariables(HTTP_USER_AGENT)))If(NotIsNull(strAL))ThenstrAL=Split(strAL,|||)Foriijj=0ToUbound(strAL)IfInstr(Agent,strAL(iijj))0ThenChkAgent=FalseendifNextEndIfEndFunction'/*'防网站小偷来采摘数据'*/functionAppeal()DimAppealNum,AppealCountAppealNum=30'同一IP10秒内请求限制30次AppealCount=Request.Cookies(AppealCount)IfAppealCount=Thenresponse.Cookies(AppealCount)=1AppealCount=1response.cookies(AppealCount).expires=dateadd(s,10,now())Elseresponse.Cookies(AppealCount)=AppealCount+1response.cookies(AppealCount).expires=dateadd(s,10,now())EndIfifint(AppealCount)int(AppealNum)thenresponse.WriteFIELDSETstyle='width:350px'LEGEND描述/LEGENDresponse.writefontstyle='font-size:14px'抓取很累,歇一会儿吧!bra易易充值-方便快捷,安全稳定易易充值-方便快捷,安全稳定href=&Website&&Website&/a/fontresponse.Write/FIELDSETresponse.endEndIfendfunction'/*'防外部提交'结合Chkpost函数'*/functionchpost()IfNotChkPost(Website)thenresponse.Writecenterresponse.WriteFIELDSETstyle='width:350px'LEGEND系统提示/LEGENDResponse.Writefontstyle='font-size:14px'response.Write ahref=返回/aresponse.Write/font/FIELDSETresponse.Writebrbrdivstyle='border:1pxsolid#CCCCCC;width:235px;height:25px;padding:5px;padding-left:15px;'ahref==_blanktitle=免费的Diggcms内容管理系统Diggcms-给你最好的/a/divresponse.Write/centerresponse.End()endifEndfunction'/*'处部提交数据查'*/FunctionChkPost(web_url)dimServer_V1,Server_V2ChkPost=FalseServer_V1=Cstr(Request.ServerVariables(HTTP_REFERER))Server_V2=Cstr(Request.ServerVariables(SERVER_NAME))''--------------------------------------------''Instr(所有,其中),包括0,否则=0''--------------------------------------------IfMid(Server_V1,8,Len(Server_V2))Server_V2orInstr(web_url,Server_V2)=0ThenChkPost=FalseElseChkPost=TrueEndIfEndFunction'========================================================文件操作易易充值-方便快捷,安全稳定易易充值-方便快捷,安全稳定'/*'删除文件'*/FunctionDelFile(DelFilePath)OnErrorResumeNextDelFile=FalsesetMyFileObject=Server.CreateOBject(Scripting.FileSystemObject)MyFileObject.DeleteFile&Server.MapPath(&DelFilePath&)&SetMyFileObject=NothingIf0=Error53=ErrThenDelFile=TrueelseCatchError(&DelFilePath&文件无法删除!)endifOnErrorGoTo0EndFunction'/*'检查多层目录不存在,则生成'*/functionCreateDIR(LocalPath)dimpatharr,path_level,i,pathtmp,cpath,FileObjectonerrorresumenextLocalPath=Server.MapPath(LocalPath)LocalPath=replace(LocalPath,\,/)setFileObject=server.createobject(Scripting.FileSystemObject)patharr=split(LocalPath,/)path_level=ubound(patharr)fori=0topath_levelifi=0thenpathtmp=patharr(0)&/elsepathtmp=pathtmp&patharr(i)&/cpath=left(pathtmp,len(pathtmp)-1)ifnotFileObject.FolderExists(cpath)thenFileObject.CreateFolder(cpath)nextsetFileObject=nothingiferr.number0thenCreateDIR=falseerr.
本文标题:ASP功能函数大全
链接地址:https://www.777doc.com/doc-6296543 .html