ImageVerifierCode 换一换
格式:DOCX , 页数:87 ,大小:47.43KB ,
资源ID:5849982      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/5849982.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(ASP功能函数大全.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

ASP功能函数大全.docx

1、ASP功能函数大全ASP功能函数大全在这里给大家献上ASP各种函数功能木块集合,这里几乎包含了常用的ASP函数,对网站开发时有着很大的帮助!%call start()开始执行Function start() call get_rq() 安全过滤 call Appeal() 防小偷程序 call webAgent() 检测客户端End FunctionFunction createRs() dim rsObj set rsObj=server.CreateObject(adodb.recordset) set createRs=rsObjEnd Functionsub showError(str

2、val) response.Write response.Write strval response.Write response.End()end sub转向Sub RedirectUrl(strHttp) Response.write location.href=&strHttp&;End Subsub Alert(sText) Response.write alert( & sText & );end subsub History(iStep) Response.write window.history( & iStep & );End Subsub Funmsg(iStep,sText

3、)Response.Write alert(&sText&);location.href=&iStep&;end sub执行非法提交检测Sub get_rq()dim qs,errc,iiiqs=request.servervariables(query_string)dim nothis(18)nothis(0)=net usernothis(1)=xp_cmdshellnothis(2)=/addnothis(3)=exec%20master.dbo.xp_cmdshellnothis(4)=net localgroup administratorsnothis(5)=selectnoth

4、is(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)=and user0errc=falsefor iii= 0 to ubound(nothis) if instr(qs,nothis(iii)0 then errc=true end ifnextif errc then Response.W

5、rite(对不起,非法URL地址请求!) response.Write response.Write response.Write Diggcms系统友情提示: response.Write   HTTP 错误 404 -URL地址请求出错 response.Write response.endend ifEnd Sub初始化被过滤的客户端列表Function webAgent() dim strAgentFilter strAgentFilter=webzip|flashget|offline|teleport If ChkAgent(strAgentFilter)=Fa

6、lse Then response.Write 错误 response.End() AddErrCode(1) Call ChkError() End If End Function * 检查浏览站点的客户端 * strAL 屏蔽的客户端标志列表Function ChkAgent(strAL) Dim Agent,iijj ChkAgent=True Agent=Trim(Lcase(Request.Servervariables(HTTP_USER_AGENT) If (Not IsNull(strAL) Then strAL=Split(strAL,|) For iijj=0 To Ubo

7、und(strAL) If Instr(Agent,strAL(iijj)0 Then ChkAgent=False end if Next End IfEnd Function/* 防网站小偷来采摘数据 */function Appeal()Dim AppealNum,AppealCount AppealNum=30 同一IP10秒内请求限制30次 AppealCount=Request.Cookies(AppealCount) If AppealCount= Then response.Cookies(AppealCount)=1 AppealCount=1 response.cookie

8、s(AppealCount).expires=dateadd(s,10,now() Else response.Cookies(AppealCount)=AppealCount+1 response.cookies(AppealCount).expires=dateadd(s,10,now() End If if int(AppealCount)int(AppealNum) then response.Write 描述 response.write 抓取很累,歇一会儿吧!&Website& response.Write response.end End If end function/* 防外

9、部提交 结合Chkpost函数 */function chpost()If Not ChkPost(Website) then response.Write response.Write 系统提示 Response.Write response.Write    返回 response.Write response.Write Diggcms给你最好的 response.Write response.End()end ifEnd function/* 处部提交数据查 */Function ChkPost(web_url)dim Server_V1,Server_V

10、2ChkPost=FalseServer_V1=Cstr(Request.ServerVariables(HTTP_REFERER)Server_V2=Cstr(Request.ServerVariables(SERVER_NAME)- Instr(所有,其中),包括0,否则=0-If Mid(Server_V1,8,Len(Server_V2)Server_V2 or Instr(web_url,Server_V2)=0 Then ChkPost=FalseElse ChkPost=TrueEnd IfEnd Function=文件操作/* 删除文件 */Function DelFile(D

11、elFilePath)On Error Resume NextDelFile= Falseset MyFileObject=Server.CreateOBject(Scripting.FileSystemObject)MyFileObject.DeleteFile&Server.MapPath(&DelFilePath&)&Set MyFileObject= NothingIf 0 = Err or 53 = Err Then DelFile= Trueelse CatchError(&DelFilePath&文件无法删除!)end ifOn Error GoTo 0End Function/

12、* 检查多层目录不存在,则生成 */function CreateDIR(LocalPath) dim patharr,path_level,i,pathtmp,cpath,FileObject on error resume next LocalPath = Server.MapPath(LocalPath) LocalPath = replace(LocalPath,/) set FileObject = server.createobject(Scripting.FileSystemObject) patharr = split(LocalPath,/) path_level = ubo

13、und(patharr) for i = 0 to path_level if i=0 then pathtmp = patharr(0) & / else pathtmp = pathtmp & patharr(i) & / cpath = left(pathtmp,len(pathtmp)-1) if not FileObject.FolderExists(cpath) then FileObject.CreateFolder(cpath) next set FileObject = nothing if err.number0 then CreateDIR = false err.Cle

14、ar else CreateDIR = true end if end function/* cookie编码加密 */Function CodeCookie(Str) Dim i Dim StrRtn For i = Len(Str) To 1 Step -1 StrRtn = StrRtn & AscW(Mid(Str, i, 1) If (i 1) Then StrRtn = StrRtn & a Next CodeCookie = StrRtnEnd Function/*cookie解密 */ Function DecodeCookie(Str) Dim i Dim StrArr, S

15、trRtn StrArr = Split(Str, a) For i = 0 To UBound(StrArr) If IsNumeric(StrArr(i) = True Then StrRtn = ChrW(StrArr(i) & StrRtn Else StrRtn = Str Exit Function End If Next DecodeCookie = StrRtnEnd Function/* * 设置Cookies * vparameter:参数,val:值 */Function SetCookies(vparameter,val)response.Cookies(vparame

16、ter)=valresponse.Cookies(vparameter).Expires=dateadd(H,12,now()End Function/* *读取Cookies */Function GetCookies(vparameter)GetCookies=request.Cookies(vparameter)End Function=安全过滤/* 安全过滤 */Function SafeSql(Str,Flag)SafeSql=StrIf Flag=1 Then If Not IsNumeric(SafeSql) Or Trim(SafeSql)= Then response.Wri

17、te response.Write 描述 Response.Write 参数错误,参数类型应为数值型。当前值是:&Str& response.Write response.Write 好财经给你最好的 Response.End End IfElseIf Flag=2 Then Str =trim(Str) Str = replace(Str, , >) Str = replace(Str, , <) Str=Replace(Str,\) Str=Replace(Str,-,--) Str = Replace(Str, CHR(34), ") 过滤

18、Str = Replace(Str, CHR(39), ') 过滤 Str = Replace(Str, CHR(13)&CHR(10), ) 回车换行 Str =Replace(Str,CHR(42),*) “*” Str =Replace(Str,CHR(44),,) “,” Str = Replace(Str, select, select) Str = Replace(Str, join, join) Str = Replace(Str, union, union) Str = Replace(Str, where, where) Str = Replace(S

19、tr, insert, insert) Str = Replace(Str, delete, delete) Str = Replace(Str, update, update) Str = Replace(Str, like, like) Str = Replace(Str, drop, drop) Str = Replace(Str, create, create) Str = Replace(Str, modify, modify) Str = Replace(Str, rename, rename) Str = Replace(Str, alter, alter) Str = Repl

20、ace(Str, cast, cast) SafeSql=StrElse response.Write 描述 Response.Write 参数错误SafeSql方法参数在1,2范围内 response.Write response.Write 好财经给你最好的 Response.EndEnd IfEnd Function/* HTML解码函数 */Function HTMLDecode(refStringing) Dim fString fString=refStringing If Not IsNull(fString) Then fString = Replace(fString, &g

21、t;, ) fString = Replace(fString, <, 0 then fString = Replace(fString, CHR(13)&CHR(10), ) 回车换行 end if fString = Replace(fString, select, select) fString = Replace(fString, join, join) fString = Replace(fString, union, union) fString = Replace(fString, where, where) fString = Replace(fString, inser

22、t, insert) fString = Replace(fString, delete, delete) fString = Replace(fString, update, update) fString = Replace(fString, like, like) fString = Replace(fString, drop, drop) fString = Replace(fString, create, create) fString = Replace(fString, modify, modify) fString = Replace(fString, rename, rena

23、me) fString = Replace(fString, alter, alter) fString = Replace(fString, cast, cast) HTMLDecode = fString End If End Function/* 防注入 */Function FunSQL(Str)If Isnull(Str) ThenFunSQL = Exit Function End If Str=trim(Str)Str = Replace(Str,Chr(0), 1, -1, 1)Str = Replace(Str, , ", 1, -1, 1)Str = Replace(Str,>, 1, -1, 1) Str =

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1