|
|
|
ASP函数库
作者:Webmaster 来源:Linuxdby.com 点击:
日期:2007-05-31
[收藏] [投稿]
IE是否经常中毒?推荐您
|
strFileName = Swj ObjAllPath = "" If Right(strFileDir,1)<>"\" Then strFileDir=strFileDir&"\" ObjAllPath =strFileDir&Objwj If CheckFile(ObjAllPath) Then DelFile(ObjAllPath) formsize=Request.TotalBytes if (formsize<=(RetSize*1024*1024)) then Formdata=Request.BinaryRead(formsize) Pos_ts=LenB(getByteString(Chr(13) & Chr(10) & Chr(13) & Chr(10))) Pos_b=InstrB(Formdata,getByteString(Chr(13) & Chr(10) & Chr(13) & Chr(10)))+Pos_ts nFormdata=MidB(Formdata,Pos_b) Pos_ts=InstrB(nFormdata,getByteString(Chr(13) & Chr(10) & "--")) nnFormdata=MidB(nFormdata,Pos_ts) Pos_e=LenB(Formdata)-LenB(nnFormdata)-Pos_b+1 datastart =Pos_b dataend=Pos_e set oUpStream = Server.CreateObject("adodb.stream") oUpStream.Type = 1 oUpStream.Mode = 3 oUpStream.Open set oStream = Server.CreateObject("adodb.stream") oStream.Type = 1 oStream.Mode = 3 oStream.Open oUpStream.Write Formdata oUpStream.position=datastart-1 oUpStream.copyto oStream,dataend oStream.SaveToFile ObjAllPath,2 oStream.Close set oStream=nothing UpFsRn=True End If End function '************************************************** '函数ID:0019[过滤HTML脚本] '函数名:FilterJS '作 用:过滤HTML脚本 '参 数:strHTML ---- 被检测的HTML字串 '返回值:返回过滤后的HTML '************************************************** Function FilterJS(ByVal strHTML) Dim objReg,strContent If IsNull(strHTML) OR strHTML="" Then Exit Function Set objReg=New RegExp objReg.IgnoreCase =True objReg.Global=True objReg.Pattern="(&#)" strContent=objReg.Replace(strHTML,"") objReg.Pattern="(function|meta|value|window\.|script|js:|about:|file:|Document\.|vbs:|frame|cookie)" strContent=objReg.Replace(strContent,"") objReg.Pattern="(on(finish|mouse|Exit=|error|click|key|load|focus|Blur))" strContent=objReg.Replace(strContent,"") FilterJS=strContent strContent="" Set objReg=Nothing End Function '************************************************** '函数ID:0020[创建MsAccess数据库] '函数名:CrDb_MsAccess '作 用:创建MsAccess数据库 '参 数:DbPath ---- 目标目录信息 '参 数:DbFileName ---- 目标库文件名称 '参 数:DbUpwd ---- 目标库打开密码 '返回值:建立成功返回 True 否则 False '************************************************** Public Function CrDb_MsAccess(ByVal DbPath,ByVal DbFileName,ByVal DbUpwd) CrDb_MsAccess=False On Error GoTo 0 On Error Resume Next DIM fxztxt,fu_fu_db_str,fu_db_str fxztxt=Chr(60)&"%Response.end()%"&Chr(62) If Right(DbPath,1)<>"\" Then DbPath=DbPath & "\" fu_fu_db_str="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&DbPath&"temp.mdb;" fu_db_str ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&DbPath&DbFileName&";Jet OLEDB:Database Password="&DbUpwd&";" Set fu_Ca = Server.CreateObject("ADOX.Catalog") fu_Ca.Create fu_fu_db_str Set fu_Ca = Nothing Set fu_Je = Server.CreateObject("JRO.JetEngine") fu_Je.CompactDatabase fu_fu_db_str,fu_db_str Set fu_fso = CreateObject("Scripting.FileSystemObject") fu_fso.DeleteFile(DbPath&"temp.mdb") Set fu_Je = Nothing Set fu_fso = Nothing set fu_Conn =server.createobject("ADODB.Connection") set fu_Rs =server.createobject("ADODB.Recordset") fu_Conn.open fu_db_str fu_Sql_Str="CREATE TABLE [0] ([0] Text DEFAULT Notxt NOT NULL,[11] int IDENTITY (1, 1) NOT NULL PRIMARY KEY)" fu_Conn.Execute(fu_Sql_Str) fu_Sql_Str="Select * From [0]" fu_Rs.open fu_Sql_Str,fu_Conn,1,3 fu_Rs.addnew fu_Rs("0")=fxztxt fu_Rs.update fu_Rs.Close fu_Conn.Close Set fu_Rs = Nothing Set fu_Conn = Nothing If Err.Number = 0 Then CrDb_MsAccess=True End If On Error GoTo 0 End function '************************************************** '函数ID:0021[创建MsSQLServer数据库] '函数名:CrDb_MsSQLServer
如果您对本文有任何疑问或者建议,请到讨论区发表您的意见:
>>
论坛入口 <<
上一页 1 2 3 4 5 67 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 下一页
上一篇:SubSonic 的字段名未转义问题修正 下一篇:关于分页查询和性能问题
|
|
|
| 【文章评论】
【收藏本文】
【推荐好友】
【打印本文】
【我要投稿】 【论坛讨论】 |
相关文章: |
| ·从本质上看网页(asp,jsp)的编写 | ·学以致用 驳“ASP低能论” ·用VB构建Internet的应用·Asp的安全管理(12)·Windows 2000 安全性技术概述--3·Windows 2000 安全性技术概述--2·Windows 2000 安全性技术概述--1·ActiveX技术综述(二) ·ActiveX技术综述(一) ·动态网页技术--CGI:ASP:JSP:PHP(4)
文章评论:(1条) |
|
|
|
|
声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。 |
|