内容显示页
 
类别:ASP+VBS | 浏览(262) | 2007-2-28 11:20:00

<%
'字段内网址加上联接。
Function ToLink(Str
)
    
Dim RE 
'正则表达式对象     Dim strContent
    If IsNull(StrThen Str 
""
    
Set RE New RegExp 
'创建正则表达式对象
    
With RE
        .Global True 
'搜索应用于整个字符串
        
.IgnoreCase True 
'搜索不区分大小写的
        
strContent Str
        
'***************************************************************
        '邮件地址链接自动设置
        '***************************************************************
        
.Pattern 
"([\w]*)@([\w\.]*)"
        
strContent = .Replace(strContent"<A Href='mailto:$1@$2'>$1@$2</A> "
)
        
'***************************************************************
        '链接自动设置
        '***************************************************************
        '======根据要求再添加协议名称=======
        
Dim D(3), I
        D(0) = 
"http"
        
D(1) = 
"ftp"
        
D(2) = 
"news"
        
D(3) = 
"mms"
        
'===================================
        
For To UBound(D
)
            .
Pattern D(I) + 
":\/\/([\w\.]*)"
            
strContent = .Replace(strContent"<A Href='" D(I) + "://$1' target=_blank>" D(I) + "://$1</A> "
)
        
Next
        
'***************************************************************
    
End With
    Set 
RE 
Nothing
    
ToLink strContent
End Function

%>

引用本页地址:http://www.yongfa365.com/item/2e771a810c965750.html
 
 
相关链接
 
网友评论:
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片 看不清? 换张图试试
 
     
 
 
文章分类
 
 
.Net + C#(73)
 
 
ASP+VBS(161)
 
 
 
Linux(10)
 
 
 
web 2.0(26)
 
 
 
 
 
心程(68)
 
生活(97)
 
 
     

Power by :柳永法(yongfa365)'Blog  | 京ICP备07011491号  QQ:64049027  E-mail:64049027@qq.com yongfa365'CodePlex yongfa365'CodeGoogle

申请友情链接 要求:跟本站主题相类似正规网站,双方交换为首页位置

转载请注明来源,以便后人及时得到最新、修正、加强版!!!