易截截图软件、单文件、免安装、纯绿色、仅160KB

asp常用的正则表达式实现字符串的替换


asp常用的正则表达式实现字符串的替换,主要包括去除html标签,去除class标签和去除script标签等
去除html标签正则<\/*[^<>]*>
Function LoseHtml(ContentStr)
Dim ClsTempLoseStr,RegEx
ClsTempLoseStr = Cstr(ContentStr)
Set RegEx = New RegExp
RegEx.Pattern = "<\/*[^<>]*>"
RegEx.IgnoreCase = True
RegEx.Global = True
ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,"")
Set RegEx = Nothing
LoseHtml = ClsTempLoseStr
End function
去除网页中的class
Function LoseClassTag(ContentStr)
Dim ClsTempLoseStr,RegEx
ClsTempLoseStr = Cstr(ContentStr)
Set RegEx = New RegExp
RegEx.Pattern = "(class=){1,}(""|\'){0,1}\S+(""|\'|>|\s){0,1}"
RegEx.IgnoreCase = True
RegEx.Global = True
ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,"")
LoseClassTag = ClsTempLoseStr
Set RegEx = Nothing
End Function
Function LoseScriptTag(ContentStr)
Dim ClsTempLoseStr,RegEx
ClsTempLoseStr = Cstr(ContentStr)
Set RegEx = New RegExp
RegEx.Pattern = "(<script){1,}[^<>]*>[^\0]*(<\/script>){1,}"
RegEx.IgnoreCase = True
RegEx.Global = True
ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,"")
LoseScriptTag = ClsTempLoseStr
Set RegEx = Nothing
End Function
Function LoseIFrameTag(ContentStr)
Dim ClsTempLoseStr,RegEx
ClsTempLoseStr = Cstr(ContentStr)
Set RegEx = New RegExp
RegEx.Pattern = "(<iframe){1,}[^<>]*>[^\0]*(<\/iframe>){1,}"
RegEx.IgnoreCase = True
RegEx.Global = True
ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,"")
LoseIFrameTag = ClsTempLoseStr
Set RegEx = Nothing
End Function
Function LoseObjectTag(ContentStr)
Dim ClsTempLoseStr,RegEx
ClsTempLoseStr = Cstr(ContentStr)
Set RegEx = New RegExp
RegEx.Pattern = "(<object){1,}[^<>]*>[^\0]*(<\/object>){1,}"
RegEx.IgnoreCase = True
RegEx.Global = True
ClsTempLoseStr = RegEx.Replace(ClsTempLoseStr,"")
LoseObjectTag = ClsTempLoseStr
Set RegEx = Nothing
End Function
Function LoseSpanTag(Conte


相关文档:

如何用ASP操作XML(三)

DO自动产生的XML包含了schema信息,它描述这个XML里允许有什么节点和属性以及采用何种数据类型,而且数据节点也增加了名称空间。
schema信息在需要数据验证的地方或进行更复杂的处理或许很有用,但是,大多数情况下,我们使用的是瘦客户机,我们不需要schema信息。我们可以
利用XSLT来分离出我们想要的信息,去掉多余的信 ......

ASP中用ASPJPEG如何给FCKEditor上传的图片加水印

打开FCKEditor/Editor/Filemanager/Connectors/Asp/Commands.asp文件,修改FileUpload函数,如下所示:
Sub FileUpload( resourceType, currentFolder, sCommand )
Dim oUploader
Set oUploader = New NetRube_Upload
oUploader.MaxSize = 0
oUploader.Allowed = ConfigAllowedExtensions.Item( ......

实例学习Dreamweaver MX ASP编程基础2

按“F12”试试效果。
  注:常用的时间函数:
now()                    获取当前系统日期和时间,ASP输出可以这样写:<%=now()%>
Year(now())         获取年份 ......

[ASP中使用三层架构] 9.用户登录之一 User表与相关类

    接下来开始讲解如何用三层架构来建立用户登录过程.
    这个过程用一般的编程方式写起来很简单,从这里入手来讲解三层架构的实例,想必大家都会更容易了解其中的逻辑结构.
   
    首先我们做一些准备工作,构造这个业务需要用到的几个类,其中包括三个部 ......

asp:chart 控件画柱状图和饼图

          HTML部分:
        <asp:Chart ID="ChartBar" runat="server" Width="800px"   BackColor="#FFFFCC" Palette="BrightPastel" BorderWidth = "2" BorderColor = "#cc9900" >
    & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号