加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

ReSaveRemoteFile函数之asp实现查找文件保留替换的代码

发布时间:2023-09-06 12:32:31 所属栏目:Asp教程 来源:
导读:'================================================
'函数名:ReSaveRemoteFile
'作 用:查找文件保存替换
'参 数:Str ----原字符串
'参 数:url ----当然网站URL
'================================================
    '函数名:ReSaveRemoteFile
    '作  用:查找文件保存替换
    '参  数:Str   ----原字符串
    '参  数:url   ----当然网站URL
    '参  数:Dir -----保存目录
    '参  数:InSave ------是否保存,True,False
    '返回值:格式化取后的字符串
    '================================================
    Public Function ReSaveRemoteFile(ByVal str, ByVal URL, ByVal Dir,InSave)
        Dim s_Content
        Dim re
        Dim ContentFile, ContentFileUrl
        Dim strTempUrl,strFileUrl,DirTemp,PathTemp,FileTemp,Tempi,TempUrlArray,Arr_Path
        Dim sAllowExtName
        sAllowExtName="rm|swf"

        s_Content = str
        On Error Resume Next
        Set re = New RegExp
        re.IgnoreCase = True
        re.Global = True
        re.Pattern = "((src=|href=)((/S)+[.]{1}(" & sAllowExtName & ")))"
        Set ContentFile = re.Execute(s_Content)
        Dim sContentUrl(), n, i, bRepeat
        n = 0
        For Each ContentFileUrl In ContentFile
            strFileUrl = Replace(Replace(Replace(Replace(ContentFileUrl.Value, "src=", "", 1, -1, 1), "href=", "", 1, -1, 1), "'", ""), Chr(34), "")
            If n = 0 Then
                n = n + 1
                ReDim sContentUrl(n)
                sContentUrl(n) = strFileUrl

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章